Scope resolver for stations. More...
#include <newgrf_station.h>
Public Member Functions | |
StationScopeResolver (ResolverObject *ro, const StationSpec *statspec, BaseStation *st, TileIndex tile) | |
Constructor for station scopes. | |
uint32 | GetRandomBits () const |
Get a few random bits. | |
uint32 | GetTriggers () const |
Get the triggers. | |
void | SetTriggers (int triggers) const |
Set the triggers. | |
uint32 | GetVariable (byte variable, uint32 parameter, bool *available) const |
Get a variable value. | |
Data Fields | |
TileIndex | tile |
Tile of the station. | |
struct BaseStation * | st |
Instance of the station. | |
struct StationSpec * | statspec |
Station (type) specification. | |
CargoID | cargo_type |
Type of cargo of the station. | |
Axis | axis |
Station axis, used only for the slope check callback. |
Scope resolver for stations.
Definition at line 26 of file newgrf_station.h.
StationScopeResolver::StationScopeResolver | ( | ResolverObject * | ro, | |
const StationSpec * | statspec, | |||
BaseStation * | st, | |||
TileIndex | tile | |||
) |
Constructor for station scopes.
ro | Surrounding resolver. | |
statspec | Station (type) specification. | |
st | Instance of the station. | |
tile | Tile of the station. |
Definition at line 567 of file newgrf_station.cpp.
uint32 StationScopeResolver::GetRandomBits | ( | ) | const [virtual] |
Get a few random bits.
Default implementation has no random bits.
Reimplemented from ScopeResolver.
Definition at line 224 of file newgrf_station.cpp.
References GetStationTileRandomBits(), INVALID_TILE, BaseStation::random_bits, and st.
uint32 StationScopeResolver::GetTriggers | ( | ) | const [virtual] |
Get the triggers.
Base class returns 0
to prevent trouble.
Reimplemented from ScopeResolver.
Definition at line 230 of file newgrf_station.cpp.
References st, and BaseStation::waiting_triggers.
uint32 StationScopeResolver::GetVariable | ( | byte | variable, | |
uint32 | parameter, | |||
bool * | available | |||
) | const [virtual] |
Get a variable value.
Default implementation has no available variables.
variable | Variable to read | |
parameter | Parameter for 60+x variables | |
[out] | available | Set to false, in case the variable does not exist. |
Reimplemented from ScopeResolver.
Definition at line 278 of file newgrf_station.cpp.
References _current_company, _date, _svc, AXIS_Y, BaseStation::build_date, Clamp(), DAYS_TILL_ORIGINAL_BASE_YEAR, BaseStation::facilities, GB(), GetAnimationFrame(), BaseStation::GetByTile(), GetCompanyInfo(), GetCustomStationSpecIndex(), GetNearbyTile(), GetNearbyTileInformation(), BaseStation::GetNewGRFVariable(), GetRailStationAxis(), GetRailType(), GetReverseRailTypeTranslation(), GetStationGfx(), GetTerrainType(), GetTileSlope(), StationSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, ResolverObject::grffile, StationSpecList::grfid, HasBit(), HasStationReservation(), HasStationTileRail(), INVALID_AXIS, INVALID_TILE, IsCustomStationSpecIndex(), StationSpecList::localidx, BaseStation::owner, ScopeResolver::ro, SetBit(), SLOPE_EW, BaseStation::speclist, st, statspec, BaseStation::string_id, and BaseStation::TileBelongsToRailStation().
void StationScopeResolver::SetTriggers | ( | int | triggers | ) | const [virtual] |
Set the triggers.
Base class implementation does nothing.
triggers | Triggers to set. |
Reimplemented from ScopeResolver.
Definition at line 236 of file newgrf_station.cpp.
References st, and BaseStation::waiting_triggers.