Map accessors for roads. More...
#include "track_func.h"#include "depot_type.h"#include "rail_type.h"#include "road_func.h"#include "tile_map.h"Go to the source code of this file.
Defines | |
| #define | IsOnDesert IsOnSnow |
| #define | ToggleDesert ToggleSnow |
Enumerations | |
| enum | RoadTileType { ROAD_TILE_NORMAL, ROAD_TILE_CROSSING, ROAD_TILE_DEPOT } |
| enum | DisallowedRoadDirections { DRD_NONE, DRD_SOUTHBOUND, DRD_NORTHBOUND, DRD_BOTH, DRD_END } |
Which directions are disallowed ? More... | |
| enum | Roadside { ROADSIDE_BARREN = 0, ROADSIDE_GRASS = 1, ROADSIDE_PAVED = 2, ROADSIDE_STREET_LIGHTS = 3, ROADSIDE_TREES = 5, ROADSIDE_GRASS_ROAD_WORKS = 6, ROADSIDE_PAVED_ROAD_WORKS = 7 } |
Functions | |
| static RoadTileType | GetRoadTileType (TileIndex t) |
| static bool | IsNormalRoad (TileIndex t) |
| static bool | IsNormalRoadTile (TileIndex t) |
| static bool | IsLevelCrossing (TileIndex t) |
| static bool | IsLevelCrossingTile (TileIndex t) |
| static bool | IsRoadDepot (TileIndex t) |
| static bool | IsRoadDepotTile (TileIndex t) |
| static RoadBits | GetRoadBits (TileIndex t, RoadType rt) |
| static RoadBits | GetOtherRoadBits (TileIndex t, RoadType rt) |
| Get all RoadBits set on a tile except from the given RoadType. | |
| static RoadBits | GetAllRoadBits (TileIndex tile) |
| Get all set RoadBits on the given tile. | |
| static void | SetRoadBits (TileIndex t, RoadBits r, RoadType rt) |
| static RoadTypes | GetRoadTypes (TileIndex t) |
| static void | SetRoadTypes (TileIndex t, RoadTypes rt) |
| static bool | HasTileRoadType (TileIndex t, RoadType rt) |
| static Owner | GetRoadOwner (TileIndex t, RoadType rt) |
| static void | SetRoadOwner (TileIndex t, RoadType rt, Owner o) |
| static bool | IsRoadOwner (TileIndex t, RoadType rt, Owner o) |
| static bool | HasTownOwnedRoad (TileIndex t) |
| Checks if given tile has town owned road. | |
| DECLARE_ENUM_AS_BIT_SET (DisallowedRoadDirections) | |
| static DisallowedRoadDirections | GetDisallowedRoadDirections (TileIndex t) |
| Gets the disallowed directions. | |
| static void | SetDisallowedRoadDirections (TileIndex t, DisallowedRoadDirections drd) |
| Sets the disallowed directions. | |
| static Axis | GetCrossingRoadAxis (TileIndex t) |
| static Axis | GetCrossingRailAxis (TileIndex t) |
| static RoadBits | GetCrossingRoadBits (TileIndex tile) |
| static Track | GetCrossingRailTrack (TileIndex tile) |
| static TrackBits | GetCrossingRailBits (TileIndex tile) |
| static bool | HasCrossingReservation (TileIndex t) |
| Get the reservation state of the rail crossing. | |
| static void | SetCrossingReservation (TileIndex t, bool b) |
| Set the reservation state of the rail crossing. | |
| static TrackBits | GetCrossingReservationTrackBits (TileIndex t) |
| Get the reserved track bits for a rail crossing. | |
| static bool | IsCrossingBarred (TileIndex t) |
| static void | SetCrossingBarred (TileIndex t, bool barred) |
| static void | UnbarCrossing (TileIndex t) |
| static void | BarCrossing (TileIndex t) |
| static bool | IsOnSnow (TileIndex t) |
| static void | ToggleSnow (TileIndex t) |
| static Roadside | GetRoadside (TileIndex tile) |
| static void | SetRoadside (TileIndex tile, Roadside s) |
| static bool | HasRoadWorks (TileIndex t) |
| static bool | IncreaseRoadWorksCounter (TileIndex t) |
| static void | StartRoadWorks (TileIndex t) |
| static void | TerminateRoadWorks (TileIndex t) |
| static DiagDirection | GetRoadDepotDirection (TileIndex t) |
| RoadBits | GetAnyRoadBits (TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance=false) |
Returns the RoadBits on an arbitrary tile Special behaviour:
| |
| static void | MakeRoadNormal (TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram) |
| static void | MakeRoadCrossing (TileIndex t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadTypes rot, uint town) |
| static void | MakeRoadDepot (TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt) |
Map accessors for roads.
Definition in file road_map.h.
Which directions are disallowed ?
| DRD_NONE |
None of the directions are disallowed. |
| DRD_SOUTHBOUND |
All southbound traffic is disallowed. |
| DRD_NORTHBOUND |
All northbound traffic is disallowed. |
| DRD_BOTH |
All directions are disallowed. |
Definition at line 163 of file road_map.h.
Get all set RoadBits on the given tile.
| tile | The tile from which we want to get the RoadBits |
Definition at line 92 of file road_map.h.
References ROADTYPE_ROAD, and ROADTYPE_TRAM.
Referenced by AIRoad::CanBuildConnectedRoadPartsHere(), and CmdBuildRoadStop().
| RoadBits GetAnyRoadBits | ( | TileIndex | tile, | |
| RoadType | rt, | |||
| bool | straight_tunnel_bridge_entrance = false | |||
| ) |
Returns the RoadBits on an arbitrary tile Special behaviour:
If straight_tunnel_bridge_entrance is set a ROAD_X or ROAD_Y for bridge ramps and tunnel entrances is returned depending on the orientation of the tunnel or bridge.
| tile | the tile to get the road bits for | |
| rt | the road type to get the road bits form | |
| straight_tunnel_bridge_entrance | whether to return straight road bits for tunnels/bridges. |
Definition at line 17 of file road_map.cpp.
References AxisToRoadBits(), DIAGDIR_NE, DiagDirToAxis(), DiagDirToRoadBits(), GetRoadStopDir(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), IsDriveThroughStopTile(), IsRoadStopTile(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, ReverseDiagDir(), ROAD_NONE, ROAD_X, ROAD_Y, and TRANSPORT_ROAD.
Referenced by AIRoad::AreRoadTilesConnected(), AIRoad::CanBuildConnectedRoadPartsHere(), CanRemoveRoadWithStop(), CheckAllowRemoveRoad(), CleanUpRoadBits(), CmdBuildRoad(), GetTownRoadBits(), AIRoad::HasRoadType(), and RoadFindPathToDest().
Get the reserved track bits for a rail crossing.
| t | the tile |
Definition at line 254 of file road_map.h.
References HasCrossingReservation(), and TRACK_BIT_NONE.
Referenced by GetReservedTrackbits().
| static DisallowedRoadDirections GetDisallowedRoadDirections | ( | TileIndex | t | ) | [inline, static] |
Gets the disallowed directions.
| t | the tile to get the directions from |
Definition at line 177 of file road_map.h.
Referenced by AIRoad::AreRoadTilesConnected(), CmdBuildRoad(), CmdBuildSingleRail(), CmdTurnRoadVeh(), and DrawRoadBits().
Get all RoadBits set on a tile except from the given RoadType.
| t | The tile from which we want to get the RoadBits | |
| rt | The RoadType which we exclude from the querry |
Definition at line 81 of file road_map.h.
References ROADTYPE_ROAD, and ROADTYPE_TRAM.
Referenced by CmdBuildRoad(), and RemoveRoad().
| static bool HasCrossingReservation | ( | TileIndex | t | ) | [inline, static] |
Get the reservation state of the rail crossing.
| t | the crossing tile |
Definition at line 229 of file road_map.h.
Referenced by DrawTile_Road(), GetCrossingReservationTrackBits(), RemoveRoad(), TryReserveRailTrack(), and UpdateLevelCrossing().
| static bool HasTownOwnedRoad | ( | TileIndex | t | ) | [inline, static] |
Checks if given tile has town owned road.
| t | tile to check |
Definition at line 157 of file road_map.h.
References OWNER_TOWN, and ROADTYPE_ROAD.
Referenced by TownViewWindow::CanDeleteTown(), UpdateNearestTownForRoadTiles(), and Town::~Town().
| static void SetCrossingReservation | ( | TileIndex | t, | |
| bool | b | |||
| ) | [inline, static] |
Set the reservation state of the rail crossing.
| t | the crossing tile | |
| b | the reservation state |
Definition at line 242 of file road_map.h.
Referenced by CmdBuildRoad(), TryReserveRailTrack(), and UnreserveRailTrack().
| static void SetDisallowedRoadDirections | ( | TileIndex | t, | |
| DisallowedRoadDirections | drd | |||
| ) | [inline, static] |
Sets the disallowed directions.
| t | the tile to set the directions for | |
| drd | the disallowed directions |
Definition at line 188 of file road_map.h.
Referenced by CmdBuildRoad(), and RemoveRoad().
1.6.1