OpenTTD
|
Accessors for towns. More...
Go to the source code of this file.
Functions | |
static TownID | GetTownIndex (TileIndex t) |
Get the index of which town this house/street is attached to. | |
static void | SetTownIndex (TileIndex t, TownID index) |
Set the town index for a road or house tile. | |
static HouseID | GetCleanHouseType (TileIndex t) |
Get the type of this house, which is an index into the house spec array without doing any NewGRF related translations. | |
static HouseID | GetHouseType (TileIndex t) |
Get the type of this house, which is an index into the house spec array. | |
static void | SetHouseType (TileIndex t, HouseID house_id) |
Set the house type. | |
static bool | LiftHasDestination (TileIndex t) |
Check if the lift of this animated house has a destination. | |
static void | SetLiftDestination (TileIndex t, byte dest) |
Set the new destination of the lift for this animated house, and activate the LiftHasDestination bit. | |
static byte | GetLiftDestination (TileIndex t) |
Get the current destination for this lift. | |
static void | HaltLift (TileIndex t) |
Stop the lift of this animated house from moving. | |
static byte | GetLiftPosition (TileIndex t) |
Get the position of the lift on this animated house. | |
static void | SetLiftPosition (TileIndex t, byte pos) |
Set the position of the lift on this animated house. | |
static bool | IsHouseCompleted (TileIndex t) |
Get the completion of this house. | |
static void | SetHouseCompleted (TileIndex t, bool status) |
Mark this house as been completed. | |
static byte | GetHouseBuildingStage (TileIndex t) |
House Construction Scheme. | |
static byte | GetHouseConstructionTick (TileIndex t) |
Gets the construction stage of a house. | |
static void | IncHouseConstructionTick (TileIndex t) |
Sets the increment stage of a house It is working with the whole counter + stage 5 bits, making it easier to work: the wraparound is automatic. | |
static void | ResetHouseAge (TileIndex t) |
Sets the age of the house to zero. | |
static void | IncrementHouseAge (TileIndex t) |
Increments the age of the house. | |
static Year | GetHouseAge (TileIndex t) |
Get the age of the house. | |
static void | SetHouseRandomBits (TileIndex t, byte random) |
Set the random bits for this house. | |
static byte | GetHouseRandomBits (TileIndex t) |
Get the random bits for this house. | |
static void | SetHouseTriggers (TileIndex t, byte triggers) |
Set the activated triggers bits for this house. | |
static byte | GetHouseTriggers (TileIndex t) |
Get the already activated triggers bits for this house. | |
static byte | GetHouseProcessingTime (TileIndex t) |
Get the amount of time remaining before the tile loop processes this tile. | |
static void | SetHouseProcessingTime (TileIndex t, byte time) |
Set the amount of time remaining before the tile loop processes this tile. | |
static void | DecHouseProcessingTime (TileIndex t) |
Decrease the amount of time remaining before the tile loop processes this tile. | |
static void | MakeHouseTile (TileIndex t, TownID tid, byte counter, byte stage, HouseID type, byte random_bits) |
Make the tile a house. |
Accessors for towns.
Definition in file town_map.h.
|
inlinestatic |
Decrease the amount of time remaining before the tile loop processes this tile.
t | the house tile |
Definition at line 338 of file town_map.h.
References _me, IsTileType(), TileExtended::m6, and MP_HOUSE.
Get the type of this house, which is an index into the house spec array without doing any NewGRF related translations.
t | the tile |
Definition at line 49 of file town_map.h.
References _m, GB(), IsTileType(), Tile::m4, and MP_HOUSE.
Referenced by GetHouseType(), and UpdateHousesAndTowns().
Get the age of the house.
t | the tile of this house |
Definition at line 251 of file town_map.h.
References _m, IsHouseCompleted(), IsTileType(), Tile::m5, and MP_HOUSE.
Referenced by HouseScopeResolver::GetVariable(), and TileLoop_Town().
|
inlinestatic |
House Construction Scheme.
Construction counter, for buildings under construction. Incremented on every periodic tile processing. On wraparound, the stage of building in is increased. GetHouseBuildingStage is taking care of the real stages, (as the sprite for the next phase of house building) (Get|Inc)HouseConstructionTick is simply a tick counter between the different stages Gets the building stage of a house Since the stage is used for determining what sprite to use, if the house is complete (and that stage no longer is available), fool the system by returning the TOWN_HOUSE_COMPLETE (3), thus showing a beautiful complete house.
t | the tile of the house to get the building stage of |
Definition at line 185 of file town_map.h.
References _m, GB(), IsHouseCompleted(), IsTileType(), MP_HOUSE, and TOWN_HOUSE_COMPLETED.
Referenced by DrawTile_Town(), and HouseScopeResolver::GetVariable().
|
inlinestatic |
Gets the construction stage of a house.
t | the tile of the house to get the construction stage of |
Definition at line 197 of file town_map.h.
References _m, GB(), IsHouseCompleted(), IsTileType(), and MP_HOUSE.
Referenced by MakeSingleHouseBigger().
|
inlinestatic |
Get the amount of time remaining before the tile loop processes this tile.
t | the house tile |
Definition at line 315 of file town_map.h.
References _me, GB(), IsTileType(), and MP_HOUSE.
|
inlinestatic |
Get the random bits for this house.
This is required for newgrf house
t | the tile of this house |
Definition at line 277 of file town_map.h.
References _m, IsTileType(), Tile::m1, and MP_HOUSE.
Referenced by HouseScopeResolver::GetRandomBits().
|
inlinestatic |
Get the already activated triggers bits for this house.
This is required for newgrf house
t | the tile of this house |
Definition at line 303 of file town_map.h.
References _m, GB(), IsTileType(), and MP_HOUSE.
Referenced by HouseScopeResolver::GetTriggers().
Get the type of this house, which is an index into the house spec array.
t | the tile |
Definition at line 61 of file town_map.h.
References GetCleanHouseType(), and GetTranslatedHouseID().
Referenced by AfterLoadGame(), AnimateTile_Town(), DoWatchedCargoCallback(), DrawTile_Town(), GetFoundation_Town(), HouseScopeResolver::GetVariable(), MakeSingleHouseBigger(), MakeTownHouseBigger(), RebuildTownCaches(), SearchNearbyHouseClass(), SearchNearbyHouseGRFID(), SearchNearbyHouseID(), TileLoop_Town(), and WatchedCargoCallback().
|
inlinestatic |
Get the current destination for this lift.
t | the tile |
Definition at line 106 of file town_map.h.
Referenced by AnimateTile_Town().
|
inlinestatic |
Get the position of the lift on this animated house.
t | the tile |
Definition at line 127 of file town_map.h.
Referenced by AnimateTile_Town().
|
inlinestatic |
Get the index of which town this house/street is attached to.
t | the tile |
Definition at line 24 of file town_map.h.
References _m, IsRoadDepot(), IsTileType(), Tile::m2, MP_HOUSE, and MP_ROAD.
Referenced by AfterLoadGame(), CanBuildHouseHere(), ClosestTownFromTile(), CmdBuildSingleRail(), CmdDeleteTown(), CmdRemoveSingleRail(), FixOwnerOfRailTrack(), UpdateTownCargoes(), and Town::~Town().
|
inlinestatic |
Stop the lift of this animated house from moving.
Clears the first 4 bits of m7 at once, clearing the LiftHasDestination bit and the destination.
t | the tile |
Definition at line 117 of file town_map.h.
Referenced by AnimateTile_Town().
|
inlinestatic |
Sets the increment stage of a house It is working with the whole counter + stage 5 bits, making it easier to work: the wraparound is automatic.
t | the tile of the house to increment the construction stage of |
Definition at line 210 of file town_map.h.
References _m, AB(), GB(), IsTileType(), MP_HOUSE, SetHouseCompleted(), and TOWN_HOUSE_COMPLETED.
Referenced by MakeSingleHouseBigger().
|
inlinestatic |
Increments the age of the house.
t | the tile of this house |
Definition at line 239 of file town_map.h.
References _m, IsHouseCompleted(), IsTileType(), Tile::m5, and MP_HOUSE.
|
inlinestatic |
Get the completion of this house.
t | the tile |
Definition at line 147 of file town_map.h.
References _m, HasBit(), IsTileType(), and MP_HOUSE.
Referenced by AfterLoadGame(), GetHouseAge(), GetHouseBuildingStage(), GetHouseConstructionTick(), IncrementHouseAge(), MakeHouseTile(), MakeSingleHouseBigger(), RebuildTownCaches(), ResetHouseAge(), and TileLoop_Town().
|
inlinestatic |
Check if the lift of this animated house has a destination.
t | the tile |
Definition at line 84 of file town_map.h.
Referenced by AnimateTile_Town(), and TileLoop_Town().
|
inlinestatic |
Make the tile a house.
t | tile index |
tid | Town index |
counter | of construction step |
stage | of construction (used for drawing) |
type | of house. Index into house specs array |
random_bits | required for newgrf houses |
Definition at line 354 of file town_map.h.
References _m, IsHouseCompleted(), IsTileType(), Tile::m1, Tile::m2, Tile::m3, Tile::m5, MP_CLEAR, MP_HOUSE, SetAnimationFrame(), SetHouseCompleted(), SetHouseProcessingTime(), SetHouseType(), SetTileType(), and TOWN_HOUSE_COMPLETED.
Referenced by ClearMakeHouseTile().
|
inlinestatic |
Sets the age of the house to zero.
Needs to be called after the house is completed. During construction stages the map space is used otherwise.
t | the tile of this house |
Definition at line 228 of file town_map.h.
References _m, IsHouseCompleted(), IsTileType(), Tile::m5, and MP_HOUSE.
Referenced by MakeSingleHouseBigger().
|
inlinestatic |
Mark this house as been completed.
t | the tile |
status |
Definition at line 158 of file town_map.h.
References _m, IsTileType(), MP_HOUSE, and SB().
Referenced by AfterLoadGame(), IncHouseConstructionTick(), and MakeHouseTile().
|
inlinestatic |
Set the amount of time remaining before the tile loop processes this tile.
t | the house tile |
time | the time to be set |
Definition at line 327 of file town_map.h.
References _me, IsTileType(), MP_HOUSE, and SB().
Referenced by MakeHouseTile().
|
inlinestatic |
Set the random bits for this house.
This is required for newgrf house
t | the tile of this house |
random | the new random bits |
Definition at line 264 of file town_map.h.
References _m, IsTileType(), Tile::m1, and MP_HOUSE.
|
inlinestatic |
Set the activated triggers bits for this house.
This is required for newgrf house
t | the tile of this house |
triggers | the activated triggers |
Definition at line 290 of file town_map.h.
References _m, IsTileType(), MP_HOUSE, and SB().
Referenced by HouseScopeResolver::SetTriggers().
Set the house type.
t | the tile |
house_id | the new house type |
Definition at line 72 of file town_map.h.
References _m, GB(), IsTileType(), Tile::m4, MP_HOUSE, and SB().
Referenced by MakeHouseTile(), and UpdateHousesAndTowns().
|
inlinestatic |
Set the new destination of the lift for this animated house, and activate the LiftHasDestination bit.
t | the tile |
dest | new destination |
Definition at line 95 of file town_map.h.
References _me, SB(), and SetBit().
Referenced by AnimateTile_Town().
|
inlinestatic |
Set the position of the lift on this animated house.
t | the tile |
pos | position, from 0 to 36 |
Definition at line 137 of file town_map.h.
Referenced by AfterLoadGame(), and AnimateTile_Town().
|
inlinestatic |
Set the town index for a road or house tile.
t | the tile |
index | the index of the town |
Definition at line 36 of file town_map.h.
References _m, IsRoadDepot(), IsTileType(), Tile::m2, MP_HOUSE, and MP_ROAD.
Referenced by AfterLoadGame(), CmdBuildRoad(), GrowTownAtRoad(), RemoveRoad(), and UpdateNearestTownForRoadTiles().