49 std::optional<std::string>
grf = std::nullopt;
246 if (proc ==
nullptr)
return;
247 proc(tile, acceptance, always_accepted);
258 if (proc ==
nullptr)
return;
259 proc(tile, produced);
275 assert(proc !=
nullptr);
282 if (proc ==
nullptr)
return false;
Types related to cargoes...
Common return value for all commands.
A sort-of mixin that implements 'at(pos)' and 'operator[](pos)' only for a specific enum class.
static constexpr TimerGame< struct Calendar >::Date INVALID_DATE
Types related to commands.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirection
Enumeration for diagonal directions.
@ INVALID_DIAGDIR
Flag for an invalid DiagDirection.
Type (helpers) for enums.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23).
All geometry types in OpenTTD.
const EnumClassIndexContainer< std::array< const TileTypeProcs *, to_underlying(TileType::MaxSize)>, TileType > _tile_type_procs
Tile callback functions for each type of tile.
Slope
Enumeration for the slope-type.
Foundation
Enumeration for Foundations.
@ FOUNDATION_NONE
The tile has no foundation, the slope remains unchanged.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Class for storing amounts of cargo.
Tile description for the 'land area information' tool.
uint16_t rail_speed
Speed limit of rail (bridges and track).
std::optional< std::string > grf
newGRF used for the tile contents
StringID station_name
Type of station within the class.
StringID str
Description of the tile.
TimerGameCalendar::Date build_date
Date of construction of tile contents.
std::array< Owner, 4 > owner
Name of the owner(s).
uint64_t dparam
Parameter of the str string.
StringID airport_class
Name of the airport class.
StringID airport_name
Name of the airport.
uint16_t tram_speed
Speed limit of tram (bridges and track).
StringID roadtype
Type of road on the tile.
StringID tramtype
Type of tram on the tile.
StringID railtype
Type of rail on the tile.
uint16_t road_speed
Speed limit of road (bridges and track).
std::array< StringID, 4 > owner_type
Type of each owner.
std::optional< bool > town_can_upgrade
Whether the town can upgrade this house during town growth.
StringID airport_tile_name
Name of the airport tile.
StringID station_class
Class of station.
Tile information, used while rendering the tile.
Slope tileh
Slope of the tile.
TileIndex tile
Tile index.
Set of callback functions for performing tile operations of a given tile type.
TileLoopProc * tile_loop_proc
Called to periodically update the tile.
VehicleEnterTileProc * vehicle_enter_tile_proc
Called when a vehicle enters a tile.
DrawTileProc * draw_tile_proc
Called to render the tile and its contents to the screen.
AddAcceptedCargoProc * add_accepted_cargo_proc
Adds accepted cargo of the tile to cargo array supplied as parameter.
GetSlopePixelZProc * get_slope_pixel_z_proc
Called to get the world Z coordinate for a given location within the tile.
ChangeTileOwnerProc * change_tile_owner_proc
Called to change the ownership of elements on a tile.
GetTileDescProc * get_tile_desc_proc
Get a description of a tile (for the 'land area information' tool).
TerraformTileProc * terraform_tile_proc
Called when a terraforming operation is about to take place.
GetTileTrackStatusProc * get_tile_track_status_proc
Get available tracks and status of a tile.
CheckBuildAboveProc * check_build_above_proc
Called to check whether a bridge can be build above.
AddProducedCargoProc * add_produced_cargo_proc
Adds produced cargo of the tile to cargo array supplied as parameter.
GetFoundationProc * get_foundation_proc
Called to get the foundation.
AnimateTileProc * animate_tile_proc
Called to animate a tile.
ClickTileProc * click_tile_proc
Called when tile is clicked.
void(TileIndex tile) TileLoopProc
Tile callback function signature for running periodic tile updates.
TrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) GetTileTrackStatusProc
Tile callback function signature for getting the possible tracks that can be taken on a given tile by...
bool(TileIndex tile) ClickTileProc
Tile callback function signature for clicking a tile.
VehicleEnterTileState
Flags to describe several special states upon entering a tile.
@ EnteredStation
The vehicle entered a station.
@ CannotEnter
The vehicle cannot enter the tile.
@ EnteredWormhole
The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/...
Foundation(TileIndex tile, Slope tileh) GetFoundationProc
Tile callback function signature for getting the foundation of a tile.
VehicleEnterTileStates VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
Call the tile callback function for a vehicle entering a tile.
void AddProducedCargo(TileIndex tile, CargoArray &produced)
Obtain the produced cargo of a tile.
CommandCost(TileIndex tile, DoCommandFlags flags) ClearTileProc
Tile callback function signature for clearing a tile.
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner)
Change the owner of a tile.
void(TileInfo *ti) DrawTileProc
Tile callback function signature for drawing a tile and its contents to the screen.
void(TileIndex tile, CargoArray &produced) AddProducedCargoProc
Tile callback function signature for obtaining the produced cargo of a tile.
CommandCost(TileIndex tile, DoCommandFlags flags, Axis axis, int height) CheckBuildAboveProc
Tile callback function signature to test if a bridge can be built above a tile.
void(TileIndex tile) AnimateTileProc
Tile callback function signature for animating a tile.
void(TileIndex tile, CargoArray &acceptance, CargoTypes &always_accepted) AddAcceptedCargoProc
Tile callback function signature for obtaining cargo acceptance of a tile.
void(TileIndex tile, TileDesc &td) GetTileDescProc
Tile callback function signature for obtaining a tile description.
void(TileIndex tile, Owner old_owner, Owner new_owner) ChangeTileOwnerProc
Tile callback function signature for changing the owner of a tile.
VehicleEnterTileStates(Vehicle *v, TileIndex tile, int x, int y) VehicleEnterTileProc
Tile callback function for a vehicle entering a tile.
bool MayAnimateTile(TileIndex tile)
Test if a tile may be animated.
TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side=INVALID_DIAGDIR)
Returns information about trackdirs and signal states.
void AddAcceptedCargo(TileIndex tile, CargoArray &acceptance, CargoTypes &always_accepted)
Obtain cargo acceptance of a tile.
int(TileIndex tile, uint x, uint y, bool ground_vehicle) GetSlopePixelZProc
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile.
CommandCost(TileIndex tile, DoCommandFlags flags, int z_new, Slope tileh_new) TerraformTileProc
Tile callback function signature of the terraforming callback.
Map writing/reading functions for tiles.
static TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
TileType
The different types of tiles.
@ MaxSize
The maximum possible number of tile types to be stored in map.
Definition of the game-calendar-timer.
All types related to tracks.
TransportType
Available types of transport.
Types related to vehicles.