OpenTTD Source 20241224-master-gf74b0cf984
|
Command definitions related to tunnels and bridges. More...
Go to the source code of this file.
Functions | |
CommandCost | CmdBuildBridge (DoCommandFlag flags, TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, uint8_t road_rail_type) |
Build a Bridge. | |
CommandCost | CmdBuildTunnel (DoCommandFlag flags, TileIndex start_tile, TransportType transport_type, uint8_t road_rail_type) |
Build Tunnel. | |
void | CcBuildBridge (Commands cmd, const CommandCost &result, TileIndex end_tile, TileIndex tile_start, TransportType transport_type, BridgeType, uint8_t) |
Callback executed after a build Bridge CMD has been called. | |
Command definitions related to tunnels and bridges.
Definition in file tunnelbridge_cmd.h.
void CcBuildBridge | ( | Commands | cmd, |
const CommandCost & | result, | ||
TileIndex | end_tile, | ||
TileIndex | tile_start, | ||
TransportType | transport_type, | ||
BridgeType | , | ||
uint8_t | |||
) |
Callback executed after a build Bridge CMD has been called.
result | Whether the build succeeded |
end_tile | End tile of the bridge. |
tile_start | start tile |
transport_type | transport type. |
Definition at line 57 of file bridge_gui.cpp.
References _settings_client, SoundSettings::confirm, ConnectRoadToStructure(), CommandCost::Failed(), GetTunnelBridgeDirection(), ReverseDiagDir(), SND_27_CONSTRUCTION_BRIDGE, ClientSettings::sound, and TRANSPORT_ROAD.
Referenced by BuildDocksToolbarWindow::OnPlaceObject(), and ShowBuildBridgeWindow().
CommandCost CmdBuildBridge | ( | DoCommandFlag | flags, |
TileIndex | tile_end, | ||
TileIndex | tile_start, | ||
TransportType | transport_type, | ||
BridgeType | bridge_type, | ||
uint8_t | road_rail_type | ||
) |
Build a Bridge.
flags | type of operation |
tile_end | end tile |
tile_start | start tile |
transport_type | transport type. |
bridge_type | bridge type (hi bh) |
road_rail_type | rail type or road types. |
Definition at line 261 of file tunnelbridge_cmd.cpp.
References _current_company, _local_company, _settings_game, CommandCost::AddCost(), AddSideToSignalBuffer(), AXIS_X, AXIS_Y, AxisToDiagDir(), AxisToTrack(), ConstructionSettings::build_on_slopes, Town::cache, CalcBridgeLenCostFactor(), CalcClosestTownFromTile(), ChangeTownRating(), CheckBridgeAvailability(), CheckBridgeSlope(), CheckForDockingTile(), ClosestTownFromTile(), CMD_ERROR, GameSettings::construction, DC_EXEC, DC_QUERY_COST, DiagDirToAxis(), DirtyCompanyInfrastructureWindows(), DistanceSquare(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), ObjectSpec::flags, GetBridgeAxis(), GetBridgeHeight(), GetBridgeSpec(), GetBridgeType(), ObjectSpec::GetByTile(), CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetNorthernBridgeEnd(), GetOtherBridgeEnd(), GetRailType(), GetRoadOwner(), GetTileMaxZ(), GetTileOwner(), GetTileSlopeZ(), GetTileType(), GetTileZ(), GetTunnelBridgeDirection(), GetTunnelBridgeLength(), GetTunnelBridgeTransportType(), HasTunnelBridgeReservation(), ObjectSpec::height, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Company::infrastructure, INVALID_DIAGDIR, INVALID_RAILTYPE, INVALID_ROADTYPE, CompanyProperties::is_ai, IsBridgeAbove(), IsBridgeTile(), IsCoast(), IsPlainRail(), IsRoadDepot(), IsTileOwner(), IsTunnel(), IsValidTile(), IsWater(), MakeAqueductBridgeRamp(), MakeRailBridgeRamp(), MakeRoadBridgeRamp(), MarkBridgeDirty(), ConstructionSettings::max_bridge_height, ConstructionSettings::max_bridge_length, MP_CLEAR, MP_OBJECT, MP_RAILWAY, MP_ROAD, MP_TUNNELBRIDGE, MP_WATER, OBJECT_FLAG_ALLOW_UNDER_BRIDGE, OWNER_DEITY, OWNER_NONE, OWNER_TOWN, CompanyInfrastructure::rail, RailBuildCost(), RATING_TUNNEL_BRIDGE_UP_STEP, ReverseDiagDir(), CompanyInfrastructure::road, RoadBuildCost(), SetBridgeMiddle(), SetDParam(), SetTunnelBridgeReservation(), SLOPE_FLAT, TownCache::squared_town_zone_radius, Swap(), TileOffsByAxis(), TileX(), TileY(), TRANSPORT_RAIL, TRANSPORT_ROAD, TRANSPORT_WATER, TUNNELBRIDGE_TRACKBIT_FACTOR, TunnelBridgeClearCost(), ValParamRailType(), ValParamRoadType(), CompanyInfrastructure::water, Town::xy, and YapfNotifyTrackLayoutChange().
CommandCost CmdBuildTunnel | ( | DoCommandFlag | flags, |
TileIndex | start_tile, | ||
TransportType | transport_type, | ||
uint8_t | road_rail_type | ||
) |
Build Tunnel.
flags | type of operation |
start_tile | start tile of tunnel |
transport_type | transport type |
road_rail_type | railtype or roadtype |
Definition at line 624 of file tunnelbridge_cmd.cpp.
References _build_tunnel_endtile, _cheats, _current_company, _settings_game, CommandCost::AddCost(), AddSideToSignalBuffer(), AXIS_Y, Town::cache, CalcClosestTownFromTile(), CMD_ERROR, ComplementSlope(), GameSettings::construction, Cheats::crossing_tunnels, DC_EXEC, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, DiagDirToAxis(), DiagDirToDiagTrack(), DirtyCompanyInfrastructureWindows(), DistanceSquare(), EXPENSES_CONSTRUCTION, CommandCost::Failed(), FindClearedObject(), ClearedObjectArea::first_tile, CommandCost::GetCost(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), GetInclinedSlopeDirection(), GetTileSlopeZ(), HasTileWaterGround(), Company::infrastructure, INVALID_DIAGDIR, INVALID_RAILTYPE, INVALID_ROADTYPE, INVALID_TILE, IsTunnelInWayDir(), IsValidTile(), MakeRailTunnel(), MakeRoadTunnel(), ConstructionSettings::max_tunnel_length, Map::MaxX(), OWNER_DEITY, OWNER_NONE, OWNER_TOWN, CompanyInfrastructure::rail, RailBuildCost(), ReverseDiagDir(), CompanyInfrastructure::road, RoadBuildCost(), TownCache::squared_town_zone_radius, TileOffsByDiagDir(), TileX(), TileY(), TRANSPORT_RAIL, TRANSPORT_ROAD, TUNNELBRIDGE_TRACKBIT_FACTOR, ValParamRailType(), ValParamRoadType(), Cheat::value, Town::xy, and YapfNotifyTrackLayoutChange().