58 return !_railtypes_hidden_mask.
Test(railtype) &&
Company::Get(company)->avail_railtypes.Test(railtype);
69 avail.
Reset(_railtypes_hidden_mask);
97 if (rti->
label == 0)
continue;
107 if (!rts.
All(required))
continue;
190 if (rti->
label == label)
return r;
193 if (allow_alternate_labels) {
constexpr bool All(const Timpl &other) const
Test if all of the values are set.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr Timpl & Reset()
Reset all bits.
constexpr Timpl & Set()
Set all bits.
constexpr bool Any(const Timpl &other) const
Test if any of the given values are set.
This struct contains all the info that is needed to draw and construct tracks.
TimerGameCalendar::Date introduction_date
Introduction date.
RailTypes introduces_railtypes
Bitmask of which other railtypes are introduced when this railtype is introduced.
RailTypes introduction_required_railtypes
Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_dat...
RailTypeLabel label
Unique 32 bit rail type identifier.
std::vector< RailTypeLabel > alternate_labels
Rail type labels this type provides in addition to the main label.
Wrapper class to abstract away the way the tiles are stored.
static Date date
Current date in days (day counter).
static constexpr TimerGame< struct Calendar >::Date MAX_DATE
The date of the last day of the max year.
static constexpr int DAYS_IN_YEAR
days per year
Definition of stuff that is very close to a company, like the company struct itself.
CompanyID _current_company
Company currently doing an action.
Functions related to companies.
@ RAILVEH_WAGON
simple wagon, not motorized
constexpr bool IsInsideMM(const size_t x, const size_t min, const size_t max) noexcept
Checks if a value is in an interval.
RailTypes GetCompanyRailTypes(CompanyID company, bool introduces)
Get the rail types the given company can build.
bool HasAnyRailTypesAvail(const CompanyID company)
Test if any buildable railtype is available for a company.
bool HasRailTypeAvail(const CompanyID company, const RailType railtype)
Finds out if a company has a certain buildable railtype available.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
RailType GetTileRailType(Tile tile)
Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.
RailTypes AddDateIntroducedRailTypes(RailTypes current, TimerGameCalendar::Date date)
Add the rail types that are to be introduced at the given date.
RailTypes GetRailTypes(bool introduces)
Get list of rail types, regardless of company availability.
bool ValParamRailType(const RailType rail)
Validate functions for rail building.
RailTypes GetAllIntroducesRailTypes(RailTypes railtypes)
Returns all introduced railtypes for a set of railtypes.
const RailTypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
RailType
Enumeration for all possible railtypes.
@ RAILTYPE_BEGIN
Used for iterations.
@ RAILTYPE_END
Used for iterations.
@ INVALID_RAILTYPE
Flag for invalid railtype.
bool IsLevelCrossing(Tile t)
Return whether a tile is a level crossing.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
Maps accessors for stations.
bool HasStationRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
Definition of base types and functions in a cross-platform compatible way.
Information about a vehicle.
LandscapeTypes climates
Climates supported by the engine.
static Pool::IterateWrapperFiltered< Engine, EngineTypeFilter > IterateType(VehicleType vt, size_t from=0)
Returns an iterable ensemble of all valid engines of the given type.
LandscapeType landscape
the landscape we're currently in
GameCreationSettings game_creation
settings used during the creation of a game (map)
static Titem * Get(auto index)
Returns Titem with given index.
Information about a rail vehicle.
RailTypes railtypes
Railtypes, mangled if elrail is disabled.
Templated helper to make a type-safe 'typedef' representing a single POD value.
static debug_inline TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
@ MP_ROAD
A tile with road (or tram tracks)
@ MP_STATION
A tile of a station.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
Definition of the game-calendar-timer.
Data related to rail tracks.
@ TRANSPORT_RAIL
Transport by train.
Functions that have tunnels and bridges in common.
TransportType GetTunnelBridgeTransportType(Tile t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
@ VEH_TRAIN
Train vehicle type.