OpenTTD Source
20241108-master-g80f628063a
|
Accessors for towns. More...
Go to the source code of this file.
Functions | |
TownID | GetTownIndex (Tile t) |
Get the index of which town this house/street is attached to. More... | |
void | SetTownIndex (Tile t, TownID index) |
Set the town index for a road or house tile. More... | |
HouseID | GetCleanHouseType (Tile t) |
Get the type of this house, which is an index into the house spec array without doing any NewGRF related translations. More... | |
HouseID | GetHouseType (Tile t) |
Get the type of this house, which is an index into the house spec array. More... | |
void | SetHouseType (Tile t, HouseID house_id) |
Set the house type. More... | |
bool | LiftHasDestination (Tile t) |
Check if the lift of this animated house has a destination. More... | |
void | SetLiftDestination (Tile t, uint8_t dest) |
Set the new destination of the lift for this animated house, and activate the LiftHasDestination bit. More... | |
uint8_t | GetLiftDestination (Tile t) |
Get the current destination for this lift. More... | |
void | HaltLift (Tile t) |
Stop the lift of this animated house from moving. More... | |
uint8_t | GetLiftPosition (Tile t) |
Get the position of the lift on this animated house. More... | |
void | SetLiftPosition (Tile t, uint8_t pos) |
Set the position of the lift on this animated house. More... | |
bool | IsHouseCompleted (Tile t) |
Get the completion of this house. More... | |
void | SetHouseCompleted (Tile t, bool status) |
Mark this house as been completed. More... | |
uint8_t | GetHouseBuildingStage (Tile t) |
House Construction Scheme. More... | |
uint8_t | GetHouseConstructionTick (Tile t) |
Gets the construction stage of a house. More... | |
void | IncHouseConstructionTick (Tile 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. More... | |
void | ResetHouseAge (Tile t) |
Sets the age of the house to zero. More... | |
void | IncrementHouseAge (Tile t) |
Increments the age of the house. More... | |
TimerGameCalendar::Year | GetHouseAge (Tile t) |
Get the age of the house. More... | |
void | SetHouseRandomBits (Tile t, uint8_t random) |
Set the random bits for this house. More... | |
uint8_t | GetHouseRandomBits (Tile t) |
Get the random bits for this house. More... | |
void | SetHouseTriggers (Tile t, uint8_t triggers) |
Set the activated triggers bits for this house. More... | |
uint8_t | GetHouseTriggers (Tile t) |
Get the already activated triggers bits for this house. More... | |
uint8_t | GetHouseProcessingTime (Tile t) |
Get the amount of time remaining before the tile loop processes this tile. More... | |
void | SetHouseProcessingTime (Tile t, uint8_t time) |
Set the amount of time remaining before the tile loop processes this tile. More... | |
void | DecHouseProcessingTime (Tile t) |
Decrease the amount of time remaining before the tile loop processes this tile. More... | |
void | MakeHouseTile (Tile t, TownID tid, uint8_t counter, uint8_t stage, HouseID type, uint8_t random_bits) |
Make the tile a house. More... | |
Accessors for towns.
Definition in file town_map.h.
|
inline |
Decrease the amount of time remaining before the tile loop processes this tile.
t | the house tile |
Definition at line 337 of file town_map.h.
References IsTileType(), Tile::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 48 of file town_map.h.
References GB(), IsTileType(), Tile::m3(), Tile::m4(), and MP_HOUSE.
Referenced by GetHouseType(), and UpdateHousesAndTowns().
|
inline |
Get the age of the house.
t | the tile of this house |
Definition at line 250 of file town_map.h.
References IsHouseCompleted(), IsTileType(), Tile::m5(), and MP_HOUSE.
Referenced by HouseScopeResolver::GetVariable().
|
inline |
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 184 of file town_map.h.
References GB(), IsHouseCompleted(), IsTileType(), Tile::m5(), MP_HOUSE, and TOWN_HOUSE_COMPLETED.
Referenced by HouseScopeResolver::GetVariable().
|
inline |
Gets the construction stage of a house.
t | the tile of the house to get the construction stage of |
Definition at line 196 of file town_map.h.
References GB(), IsHouseCompleted(), IsTileType(), Tile::m5(), and MP_HOUSE.
Referenced by AdvanceSingleHouseConstruction().
|
inline |
Get the amount of time remaining before the tile loop processes this tile.
t | the house tile |
Definition at line 314 of file town_map.h.
References GB(), IsTileType(), Tile::m6(), and MP_HOUSE.
|
inline |
Get the random bits for this house.
This is required for newgrf house
t | the tile of this house |
Definition at line 276 of file town_map.h.
References IsTileType(), Tile::m1(), and MP_HOUSE.
Referenced by HouseScopeResolver::GetRandomBits().
|
inline |
Get the already activated triggers bits for this house.
This is required for newgrf house
t | the tile of this house |
Definition at line 302 of file town_map.h.
References GB(), IsTileType(), Tile::m3(), 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 60 of file town_map.h.
References GetCleanHouseType(), and GetTranslatedHouseID().
Referenced by AdvanceHouseConstruction(), AnimateTile_Town(), ClearTownHouse(), DrawTile_Town(), GetFoundation_Town(), NIHHouse::GetGRFID(), NIHHouse::GetSpec(), NIHHouse::IsInspectable(), NIHHouse::Resolve(), SearchNearbyHouseClass(), SearchNearbyHouseGRFID(), SearchNearbyHouseID(), TileLoop_Town(), and WatchedCargoCallback().
|
inline |
Get the current destination for this lift.
t | the tile |
Definition at line 105 of file town_map.h.
References GB(), and Tile::m7().
|
inline |
Get the position of the lift on this animated house.
t | the tile |
Definition at line 126 of file town_map.h.
References GB(), and Tile::m6().
|
inline |
Get the index of which town this house/street is attached to.
t | the tile |
Definition at line 23 of file town_map.h.
References IsRoadDepot(), IsTileType(), Tile::m2(), MP_HOUSE, and MP_ROAD.
Referenced by Station::CatchmentCoversTown(), ClosestTownFromTile(), NIHHouse::GetParent(), Station::RemoveFromAllNearbyLists(), NIHHouse::SetStringParameters(), TestTownOwnsBridge(), and Town::~Town().
|
inline |
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 116 of file town_map.h.
References Tile::m7(), and SB().
|
inline |
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 209 of file town_map.h.
References AB(), GB(), IsTileType(), Tile::m5(), MP_HOUSE, SetHouseCompleted(), and TOWN_HOUSE_COMPLETED.
Referenced by AdvanceSingleHouseConstruction().
|
inline |
Increments the age of the house.
t | the tile of this house |
Definition at line 238 of file town_map.h.
References IsHouseCompleted(), IsTileType(), Tile::m5(), and MP_HOUSE.
|
inline |
Get the completion of this house.
t | the tile |
Definition at line 146 of file town_map.h.
References HasBit(), IsTileType(), Tile::m3(), and MP_HOUSE.
Referenced by ClearTownHouse(), GetHouseAge(), GetHouseBuildingStage(), GetHouseConstructionTick(), IncrementHouseAge(), MakeHouseTile(), and ResetHouseAge().
|
inline |
Check if the lift of this animated house has a destination.
t | the tile |
Definition at line 83 of file town_map.h.
References HasBit(), and Tile::m7().
|
inline |
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 353 of file town_map.h.
References HouseSpec::Get(), 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().
|
inline |
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 227 of file town_map.h.
References IsHouseCompleted(), IsTileType(), Tile::m5(), and MP_HOUSE.
|
inline |
Mark this house as been completed.
t | the tile |
status |
Definition at line 157 of file town_map.h.
References IsTileType(), Tile::m3(), MP_HOUSE, and SB().
Referenced by IncHouseConstructionTick(), and MakeHouseTile().
|
inline |
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 326 of file town_map.h.
References IsTileType(), Tile::m6(), MP_HOUSE, and SB().
Referenced by MakeHouseTile().
|
inline |
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 263 of file town_map.h.
References IsTileType(), Tile::m1(), and MP_HOUSE.
|
inline |
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 289 of file town_map.h.
References IsTileType(), Tile::m3(), MP_HOUSE, and SB().
Set the house type.
t | the tile |
house_id | the new house type |
Definition at line 71 of file town_map.h.
References GB(), IsTileType(), Tile::m3(), Tile::m4(), MP_HOUSE, and SB().
Referenced by MakeHouseTile().
|
inline |
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 94 of file town_map.h.
References Tile::m7(), SB(), and SetBit().
|
inline |
Set the position of the lift on this animated house.
t | the tile |
pos | position, from 0 to 36 |
Definition at line 136 of file town_map.h.
References Tile::m6(), and SB().
|
inline |
Set the town index for a road or house tile.
t | the tile |
index | the index of the town |
Definition at line 35 of file town_map.h.
References IsRoadDepot(), IsTileType(), Tile::m2(), MP_HOUSE, and MP_ROAD.