Go to the documentation of this file.
57 if (org_rb & target_rb) {
58 bool connective =
false;
79 connective = (neighbor_rb & mirrored_rb) !=
ROAD_NONE;
89 connective = !
IsWater(neighbor_tile);
98 if (!connective) org_rb ^= target_rb;
117 if (c ==
nullptr)
return false;
122 static RoadTypes GetMaskForRoadTramType(RoadTramType rtt)
162 if (rti->
label == 0)
continue;
172 if ((rts & required) != required)
continue;
248 if (rti->
label == label)
return r;
251 if (allow_alternate_labels) {
288 if (e->company_avail != (CompanyMask)-1)
continue;
296 return known_roadtypes;
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
uint32 TileIndex
The index/ID of a Tile.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
static Titem * Get(size_t index)
Returns Titem with given index.
RoadType GetRoadTypeByLabel(RoadTypeLabel label, bool allow_alternate_labels)
Get the road type for a given label.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
byte landscape
the landscape we're currently in
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced.
RoadTypes avail_roadtypes
Road types available to this company.
@ INVALID_ROADTYPE
flag for invalid roadtype
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
@ DIAGDIR_END
Used for iterations.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
bool HasRoadTypeAvail(const CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction.
@ ROADTYPE_END
Used for iterations.
static TrackBits GetTrackBits(TileIndex tile)
Gets the track bits of the given tile.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, Date date)
Add the road types that are to be introduced at the given date.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces)
Get the road types the given company can build.
Information about a vehicle.
#define MAX_DAY
The number of days till the last day.
@ VEH_ROAD
Road vehicle type.
RoadType roadtype
Road type.
Date introduction_date
Introduction date.
Owner
Enum for all companies/owners.
@ MP_ROAD
A tile with road (or tram tracks)
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
GameCreationSettings game_creation
settings used during the creation of a game (map)
static bool IsInsideMM(const T x, const size_t min, const size_t max)
Checks if a value is in an interval.
RoadBits
Enumeration for the road parts on a tile.
@ ROAD_NONE
No road-part is build.
RoadTypes _roadtypes_type
Bitmap of road/tram types.
Date _date
Current date in days (day counter)
RoadBits GetAnyRoadBits(TileIndex tile, RoadTramType rtt, bool straight_tunnel_bridge_entrance)
Returns the RoadBits on an arbitrary tile Special behaviour:
static RailTileType GetRailTileType(TileIndex t)
Returns the RailTileType (normal with or without signals, waypoint or depot).
Information about a road vehicle.
int32 Date
The type to store our dates in.
bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
Test if any buildable RoadType is available for a company.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
RoadTypeLabelList alternate_labels
Road type labels this type provides in addition to the main label.
@ TRACK_BIT_X
X-axis track.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
static TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
Adds a DiagDir to a tile.
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
Clean up unnecessary RoadBits of a planned tile.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
DiagDirection
Enumeration for diagonal directions.
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,...
@ ROADTYPE_BEGIN
Used for iterations.
RoadType
The different roadtypes we support.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
@ MP_TREES
Tile got trees.
bool _generating_world
Whether we are generating the map or not.
CompanyID _current_company
Company currently doing an action.
RoadTypeLabel label
Unique 32 bit road type identifier.
static bool IsPossibleCrossing(const TileIndex tile, Axis ax)
Return if the tile is a valid tile for a crossing.
@ MP_STATION
A tile of a station.
@ RAIL_TILE_NORMAL
Normal rail tile without signals.
@ DIAGDIR_BEGIN
Used for iterations.
static const int DAYS_IN_YEAR
days per year
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
RoadTypes ExistingRoadTypes(CompanyID c)
Returns the available RoadSubTypes for the provided RoadType If the given company is valid then will ...
static bool IsNormalRoadTile(TileIndex t)
Return whether a tile is a normal road tile.
Axis
Allow incrementing of DiagDirDiff variables.
@ OWNER_END
Last + 1 owner.
@ TRACK_BIT_Y
Y-axis track.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
byte climates
Climates supported by the engine.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
static bool IsWater(TileIndex t)
Is it a plain water tile?
@ ROADTYPES_NONE
No roadtypes.
RoadTypes introduction_required_roadtypes
Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_dat...
@ OWNER_TOWN
A town owns the tile, or a town is expanding.