56 if (org_rb & target_rb) {
57 bool connective =
false;
78 connective = (neighbor_rb & mirrored_rb) !=
ROAD_NONE;
88 connective = !
IsWater(neighbor_tile);
97 if (!connective) org_rb ^= target_rb;
118 if (c == NULL)
return false;
121 return (rts & ~avail_roadtypes) == 0;
144 FOR_ALL_ENGINES_OF_TYPE(e,
VEH_ROAD) {
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Definition of stuff that is very close to a company, like the company struct itself.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
static const int DAYS_IN_YEAR
days per year
byte landscape
the landscape we're currently in
bool ValParamRoadType(const RoadType rt)
Validate functions for rail building.
static bool IsWater(TileIndex t)
Is it a plain water tile?
Functions related to dates.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
A tile with road (or tram tracks)
Date intro_date
Date of introduction of the engine.
static TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
Adds a DiagDir to a tile.
static RoadTypes RoadTypeToRoadTypes(RoadType rt)
Maps a RoadType to the corresponding RoadTypes value.
Functions related to world/map generation.
RoadTypes GetCompanyRoadtypes(CompanyID company)
Get the road types the given company can build.
RoadType
The different roadtypes we support.
The object is owned by a superuser / goal script.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
Information about a vehicle.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
bool HasRoadTypesAvail(const CompanyID company, const RoadTypes rts)
Finds out, whether given company has all given RoadTypes available.
Map accessors for water tiles.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
RoadBits
Enumeration for the road parts on a tile.
CompanyMask company_avail
Bit for each company whether the engine is available for that company.
byte misc_flags
Miscellaneous flags.
DiagDirection
Enumeration for diagonal directions.
RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance)
Returns the RoadBits on an arbitrary tile Special behaviour:
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
Clean up unnecessary RoadBits of a planed tile.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
static bool IsPossibleCrossing(const TileIndex tile, Axis ax)
Return if the tile is a valid tile for a crossing.
static RailTileType GetRailTileType(TileIndex t)
Returns the RailTileType (normal with or without signals, waypoint or depot).
static TrackBits GetTrackBits(TileIndex tile)
Gets the track bits of the given tile.
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
Slope GetFoundationSlope(TileIndex tile, int *z)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation, the function returns the same as GetTileSlope.
Functions related to companies.
bool _generating_world
Whether we are generating the map or not.
static bool IsNormalRoadTile(TileIndex t)
Return whether a tile is a normal road tile.
Tunnel entry/exit and bridge heads.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
CompanyByte _current_company
Company currently doing an action.
uint32 TileIndex
The index/ID of a Tile.
A town owns the tile, or a town is expanding.
RoadTypes avail_roadtypes
Road types available to this company.
Normal rail tile without signals.
Functions related to OTTD's landscape.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
GameCreationSettings game_creation
settings used during the creation of a game (map)
A tile without any structures, i.e. grass, rocks, farm fields etc.
Road vehicle is a tram/light rail vehicle.
Owner
Enum for all companies/owners.
byte climates
Climates supported by the engine.
Date _date
Current date in days (day counter)
Hides the direct accesses to the map array with map accessors.
Axis
Allow incrementing of DiagDirDiff variables.