OpenTTD Source
20241108-master-g80f628063a
|
Scope resolver for generic objects and properties. More...
Public Member Functions | |
GenericScopeResolver (ResolverObject &ro, bool ai_callback) | |
Generic scope resolver. More... | |
uint32_t | GetVariable (uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const override |
Get a variable value. More... | |
Public Member Functions inherited from ScopeResolver | |
ScopeResolver (ResolverObject &ro) | |
virtual uint32_t | GetRandomBits () const |
Get a few random bits. More... | |
virtual uint32_t | GetTriggers () const |
Get the triggers. More... | |
virtual void | StorePSA (uint reg, int32_t value) |
Store a value into the persistent storage area (PSA). More... | |
Data Fields | |
CargoID | cargo_type |
uint8_t | default_selection |
uint8_t | src_industry |
Source industry substitute type. 0xFF for "town", 0xFE for "unknown". | |
uint8_t | dst_industry |
Destination industry substitute type. 0xFF for "town", 0xFE for "unknown". | |
uint8_t | distance |
AIConstructionEvent | event |
uint8_t | count |
uint8_t | station_size |
uint8_t | feature |
Data Fields inherited from ScopeResolver | |
ResolverObject & | ro |
Surrounding resolver object. | |
Private Attributes | |
bool | ai_callback |
Callback comes from the AI. | |
Scope resolver for generic objects and properties.
Definition at line 21 of file newgrf_generic.cpp.
|
inline |
Generic scope resolver.
ro | Surrounding resolver. |
ai_callback | Callback comes from the AI. |
Definition at line 38 of file newgrf_generic.cpp.
|
overridevirtual |
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 121 of file newgrf_generic.cpp.
References ai_callback, CargoSpec::bitnum, GRFFile::cargo_map, Debug, dst_industry, CargoSpec::Get(), ResolverObject::grffile, ScopeResolver::ro, and src_industry.