OpenTTD Source
20240917-master-g9ab0a47812
|
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;
115 if (rti->
label == 0)
return false;
128 if (c ==
nullptr)
return false;
133 static RoadTypes GetMaskForRoadTramType(RoadTramType rtt)
173 if (rti->
label == 0)
continue;
183 if ((rts & required) != required)
continue;
259 if (rti->
label == label)
return r;
262 if (allow_alternate_labels) {
RoadTypeFlags flags
Bit mask of road type flags.
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
@ OWNER_DEITY
The object is owned by a superuser / goal script.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
static Titem * Get(size_t index)
Returns Titem with given index.
RoadBits
Enumeration for the road parts on a tile.
RoadType GetRoadTypeByLabel(RoadTypeLabel label, bool allow_alternate_labels)
Get the road type for a given label.
constexpr bool IsInsideMM(const T x, const size_t min, const size_t max) noexcept
Checks if a value is in an interval.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
@ TRACK_BIT_X
X-axis track.
TimerGameCalendar::Date introduction_date
Introduction date.
@ ROTFB_HIDDEN
Value for hidden from construction.
RoadTypes introduces_roadtypes
Bitmask of which other roadtypes are introduced when this roadtype is introduced.
RoadTypes avail_roadtypes
Road types available to this company.
Owner
Enum for all companies/owners.
Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
@ ROADTYPE_BEGIN
Used for iterations.
bool HasRoadTypeAvail(const CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction.
@ VEH_ROAD
Road vehicle type.
DiagDirection
Enumeration for diagonal directions.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces)
Get the road types the given company can build.
Information about a vehicle.
RoadType roadtype
Road type.
uint8_t landscape
the landscape we're currently in
@ MP_ROAD
A tile with road (or tram tracks)
GameCreationSettings game_creation
settings used during the creation of a game (map)
static debug_inline TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
static constexpr TimerGame< struct Calendar >::Date MAX_DATE
The date of the last day of the max year.
@ ROADTYPES_NONE
No roadtypes.
RoadTypes _roadtypes_type
Bitmap of road/tram types.
bool IsWater(Tile t)
Is it a plain water tile?
RoadTypes
The different roadtypes we support, but then a bitmask of them.
@ ROTFB_TOWN_BUILD
Value for allowing towns to build this roadtype.
@ DIAGDIR_BEGIN
Used for iterations.
Information about a road vehicle.
bool HasAnyRoadTypesAvail(CompanyID company, RoadTramType rtt)
Test if any buildable RoadType is available for a company.
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.
RoadType
The different roadtypes we support.
uint8_t climates
Climates supported by the engine.
static debug_inline bool IsNormalRoadTile(Tile t)
Return whether a tile is a normal road 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.
@ INVALID_ROADTYPE
flag for invalid roadtype
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
static debug_inline RailTileType GetRailTileType(Tile t)
Returns the RailTileType (normal with or without signals, waypoint or depot).
@ OWNER_TOWN
A town owns the tile, or a town is expanding.
bool IsValidTile(Tile tile)
Checks if a tile is valid.
TrackBits GetTrackBits(Tile tile)
Gets the track bits of the given tile.
@ MP_TREES
Tile got trees.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
bool _generating_world
Whether we are generating the map or not.
@ ROADTYPE_END
Used for iterations.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, TimerGameCalendar::Date date)
Add the road types that are to be introduced at the given date.
RoadBits GetAnyRoadBits(Tile tile, RoadTramType rtt, bool straight_tunnel_bridge_entrance)
Returns the RoadBits on an arbitrary tile Special behaviour:
CompanyID _current_company
Company currently doing an action.
RoadTypeLabel label
Unique 32 bit road type identifier.
Axis
Allow incrementing of DiagDirDiff variables.
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_END
Used for iterations.
std::tuple< Slope, int > GetFoundationSlope(TileIndex tile)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation,...
@ TRACK_BIT_Y
Y-axis track.
@ ROAD_NONE
No road-part is build.
static Date date
Current date in days (day counter).
RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
static constexpr int DAYS_IN_YEAR
days per year
TileIndex TileAddByDiagDir(TileIndex tile, DiagDirection dir)
Adds a DiagDir to a tile.
RoadTypes introduction_required_roadtypes
Bitmask of roadtypes that are required for this roadtype to be introduced at a given introduction_dat...
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.