OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
10 #include "../newgrf_house.h"
11 #include "../newgrf_engine.h"
12 #include "../newgrf_roadtype.h"
13 #include "../newgrf_roadstop.h"
16 #define NIP(prop, base, variable, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), prop, type }
17 #define NIP_END() { nullptr, 0, 0, 0, 0 }
20 #define NIC(cb_id, base, variable, bit) { #cb_id, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->variable); }, cpp_sizeof(base, variable), bit, cb_id }
21 #define NIC_END() { nullptr, 0, 0, 0, 0 }
24 #define NIV(var, name) { name, var }
25 #define NIV_END() { nullptr, 0 }
30 #define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit)
52 NIV(0x40,
"position in consist and length"),
53 NIV(0x41,
"position and length of chain of same vehicles"),
54 NIV(0x42,
"transported cargo types"),
55 NIV(0x43,
"player info"),
56 NIV(0x44,
"aircraft info"),
57 NIV(0x45,
"curvature info"),
58 NIV(0x46,
"motion counter"),
59 NIV(0x47,
"vehicle cargo info"),
60 NIV(0x48,
"vehicle type info"),
61 NIV(0x49,
"year of construction"),
62 NIV(0x4A,
"current rail/road type info"),
63 NIV(0x4B,
"long date of last service"),
64 NIV(0x4C,
"current max speed"),
65 NIV(0x4D,
"position in articulated vehicle"),
66 NIV(0x60,
"count vehicle id occurrences"),
68 NIV(0x62,
"curvature/position difference to other vehicle"),
69 NIV(0x63,
"tile compatibility wrt. track-type"),
81 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
99 #define NICS(cb_id, bit) NIC(cb_id, StationSpec, callback_mask, bit)
112 NIV(0x40,
"platform info and relative position"),
113 NIV(0x41,
"platform info and relative position for individually built sections"),
114 NIV(0x42,
"terrain and track type"),
115 NIV(0x43,
"player info"),
116 NIV(0x44,
"path signalling info"),
117 NIV(0x45,
"rail continuation info"),
118 NIV(0x46,
"platform info and relative position from middle"),
119 NIV(0x47,
"platform info and relative position from middle for individually built sections"),
120 NIV(0x48,
"bitmask of accepted cargoes"),
121 NIV(0x49,
"platform info and relative position of same-direction section"),
122 NIV(0x4A,
"current animation frame"),
123 NIV(0x60,
"amount of cargo waiting"),
124 NIV(0x61,
"time since last cargo pickup"),
125 NIV(0x62,
"rating of cargo"),
126 NIV(0x63,
"time spent on route"),
127 NIV(0x64,
"information about last vehicle picking cargo up"),
128 NIV(0x65,
"amount of cargo acceptance"),
129 NIV(0x66,
"animation frame of nearby tile"),
130 NIV(0x67,
"land info of nearby tiles"),
131 NIV(0x68,
"station info of nearby tiles"),
132 NIV(0x69,
"information about cargo accepted in the past"),
133 NIV(0x6A,
"GRFID of nearby station tiles"),
134 NIV(0x6B,
"station ID of nearby tiles"),
139 bool IsInspectable(uint index)
const override {
return GetStationSpec(index) !=
nullptr; }
142 const void *
GetSpec(uint index)
const override {
return GetStationSpec(index); }
146 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
163 #define NICH(cb_id, bit) NIC(cb_id, HouseSpec, callback_mask, bit)
184 NIV(0x40,
"construction state of tile and pseudo-random value"),
185 NIV(0x41,
"age of building in years"),
186 NIV(0x42,
"town zone"),
187 NIV(0x43,
"terrain type"),
188 NIV(0x44,
"building counts"),
189 NIV(0x45,
"town expansion bits"),
190 NIV(0x46,
"current animation frame"),
191 NIV(0x47,
"xy coordinate of the building"),
192 NIV(0x60,
"other building counts (old house type)"),
193 NIV(0x61,
"other building counts (new house type)"),
194 NIV(0x62,
"land info of nearby tiles"),
195 NIV(0x63,
"current animation frame of nearby house tile"),
196 NIV(0x64,
"cargo acceptance history of nearby stations"),
197 NIV(0x65,
"distance of nearest house matching a given criterion"),
198 NIV(0x66,
"class and ID of nearby house tile"),
199 NIV(0x67,
"GRFID of nearby house tile"),
211 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
228 #define NICIT(cb_id, bit) NIC(cb_id, IndustryTileSpec, callback_mask, bit)
229 static const NICallback _nic_industrytiles[] = {
241 static const NIVariable _niv_industrytiles[] = {
242 NIV(0x40,
"construction state of tile"),
243 NIV(0x41,
"ground type"),
244 NIV(0x42,
"current town zone in nearest town"),
245 NIV(0x43,
"relative position"),
246 NIV(0x44,
"animation frame"),
247 NIV(0x60,
"land info of nearby tiles"),
248 NIV(0x61,
"animation stage of nearby tiles"),
249 NIV(0x62,
"get industry or airport tile ID at offset"),
261 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
268 static const NIFeature _nif_industrytile = {
277 #define NIP_PRODUCED_CARGO(prop, base, slot, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->GetProduced(slot).cargo); }, sizeof(CargoID), prop, type }
278 #define NIP_ACCEPTED_CARGO(prop, base, slot, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast<const base *>(b)->GetAccepted(slot).cargo); }, sizeof(CargoID), prop, type }
316 #undef NIP_PRODUCED_CARGO
317 #undef NIP_ACCEPTED_CARGO
319 #define NICI(cb_id, bit) NIC(cb_id, IndustrySpec, callback_mask, bit)
338 NIV(0x40,
"waiting cargo 0"),
339 NIV(0x41,
"waiting cargo 1"),
340 NIV(0x42,
"waiting cargo 2"),
341 NIV(0x43,
"distance to closest dry/land tile"),
342 NIV(0x44,
"layout number"),
343 NIV(0x45,
"player info"),
344 NIV(0x46,
"industry construction date"),
345 NIV(0x60,
"get industry tile ID at offset"),
346 NIV(0x61,
"get random tile bits at offset"),
347 NIV(0x62,
"land info of nearby tiles"),
348 NIV(0x63,
"animation stage of nearby tiles"),
349 NIV(0x64,
"distance on nearest industry with given type"),
350 NIV(0x65,
"get town zone and Manhattan distance of closest town"),
351 NIV(0x66,
"get square of Euclidean distance of closes town"),
352 NIV(0x67,
"count of industry and distance of closest instance"),
353 NIV(0x68,
"count of industry and distance of closest instance with layout filter"),
354 NIV(0x69,
"produced cargo waiting"),
355 NIV(0x6A,
"cargo produced this month"),
356 NIV(0x6B,
"cargo transported this month"),
357 NIV(0x6C,
"cargo produced last month"),
358 NIV(0x6D,
"cargo transported last month"),
359 NIV(0x6E,
"date since cargo was delivered"),
360 NIV(0x6F,
"waiting input cargo"),
361 NIV(0x70,
"production rate"),
362 NIV(0x71,
"percentage of cargo transported last month"),
374 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
381 const std::span<int32_t> GetPSA(uint index, uint32_t)
const override
384 if (i->
psa ==
nullptr)
return {};
399 #define NICO(cb_id, bit) NIC(cb_id, ObjectSpec, callback_mask, bit)
412 NIV(0x40,
"relative position"),
413 NIV(0x41,
"tile information"),
414 NIV(0x42,
"construction date"),
415 NIV(0x43,
"animation counter"),
416 NIV(0x44,
"object founder"),
417 NIV(0x45,
"get town zone and Manhattan distance of closest town"),
418 NIV(0x46,
"get square of Euclidean distance of closes town"),
421 NIV(0x60,
"get object ID at offset"),
422 NIV(0x61,
"get random tile bits at offset"),
423 NIV(0x62,
"land info of nearby tiles"),
424 NIV(0x63,
"animation stage of nearby tiles"),
425 NIV(0x64,
"distance on nearest object with given type"),
437 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
455 NIV(0x40,
"terrain type"),
456 NIV(0x41,
"enhanced tunnels"),
457 NIV(0x42,
"level crossing status"),
458 NIV(0x43,
"construction date"),
459 NIV(0x44,
"town zone"),
465 uint
GetParent(uint)
const override {
return UINT32_MAX; }
467 const void *
GetSpec(uint)
const override {
return nullptr; }
469 uint32_t
GetGRFID(uint)
const override {
return 0; }
471 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
490 #define NICAT(cb_id, bit) NIC(cb_id, AirportTileSpec, callback_mask, bit)
491 static const NICallback _nic_airporttiles[] = {
507 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
514 static const NIFeature _nif_airporttile = {
525 NIV(0x40,
"Layout number"),
526 NIV(0x48,
"bitmask of accepted cargoes"),
527 NIV(0x60,
"amount of cargo waiting"),
528 NIV(0x61,
"time since last cargo pickup"),
529 NIV(0x62,
"rating of cargo"),
530 NIV(0x63,
"time spent on route"),
531 NIV(0x64,
"information about last vehicle picking cargo up"),
532 NIV(0x65,
"amount of cargo acceptance"),
533 NIV(0x69,
"information about cargo accepted in the past"),
534 NIV(0xF1,
"type of the airport"),
535 NIV(0xF6,
"airport block status"),
536 NIV(0xFA,
"built date"),
548 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
555 const std::span<int32_t> GetPSA(uint index, uint32_t)
const override
574 NIV(0x40,
"larger town effect on this town"),
575 NIV(0x41,
"town index"),
576 NIV(0x82,
"population"),
577 NIV(0x94,
"zone radius 0"),
578 NIV(0x96,
"zone radius 1"),
579 NIV(0x98,
"zone radius 2"),
580 NIV(0x9A,
"zone radius 3"),
581 NIV(0x9C,
"zone radius 4"),
582 NIV(0xB6,
"number of buildings"),
588 uint
GetParent(uint)
const override {
return UINT32_MAX; }
590 const void *
GetSpec(uint)
const override {
return nullptr; }
592 uint32_t
GetGRFID(uint)
const override {
return 0; }
595 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
601 const std::span<int32_t> GetPSA(uint index, uint32_t grfid)
const override
605 for (
const auto &it : t->psa_list) {
606 if (it->grfid == grfid)
return it->storage;
623 NIV(0x40,
"terrain type"),
624 NIV(0x41,
"enhanced tunnels"),
625 NIV(0x42,
"level crossing status"),
626 NIV(0x43,
"construction date"),
627 NIV(0x44,
"town zone"),
633 uint
GetParent(uint)
const override {
return UINT32_MAX; }
635 const void *
GetSpec(uint)
const override {
return nullptr; }
637 uint32_t
GetGRFID(uint)
const override {
return 0; }
639 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
662 #define NICRS(cb_id, bit) NIC(cb_id, RoadStopSpec, callback_mask, bit)
672 NIV(0x40,
"view/rotation"),
673 NIV(0x41,
"stop type"),
674 NIV(0x42,
"terrain type"),
675 NIV(0x43,
"road type"),
676 NIV(0x44,
"tram type"),
677 NIV(0x45,
"town zone and Manhattan distance of town"),
678 NIV(0x46,
"square of Euclidean distance of town"),
679 NIV(0x47,
"player info"),
680 NIV(0x48,
"bitmask of accepted cargoes"),
681 NIV(0x49,
"current animation frame"),
682 NIV(0x60,
"amount of cargo waiting"),
683 NIV(0x61,
"time since last cargo pickup"),
684 NIV(0x62,
"rating of cargo"),
685 NIV(0x63,
"time spent on route"),
686 NIV(0x64,
"information about last vehicle picking cargo up"),
687 NIV(0x65,
"amount of cargo acceptance"),
688 NIV(0x66,
"animation frame of nearby tile"),
689 NIV(0x67,
"land info of nearby tiles"),
690 NIV(0x68,
"road stop info of nearby tiles"),
691 NIV(0x69,
"information about cargo accepted in the past"),
692 NIV(0x6A,
"GRFID of nearby road stop tiles"),
693 NIV(0x6B,
"road stop ID of nearby tiles"),
698 bool IsInspectable(uint index)
const override {
return GetRoadStopSpec(index) !=
nullptr; }
701 const void *
GetSpec(uint index)
const override {
return GetRoadStopSpec(index); }
705 uint Resolve(uint index, uint var, uint32_t param,
bool &avail)
const override
710 return ro.GetScope(
VSG_SCOPE_SELF)->GetVariable(var, param, avail);
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
A resolver object to be used with feature 0F spritegroups.
@ CBID_OBJECT_COLOUR
Called to determine the colour of a town building.
@ WO_CACHED
Resolve wagon overrides using TrainCache::cached_override.
const void * GetInstance(uint) const override
Get the instance given an index.
@ CBM_OBJ_ANIMATION_SPEED
decides animation speed
@ CBM_IND_CARGO_SUFFIX
cargo sub-type display
static Titem * Get(size_t index)
Returns Titem with given index.
@ CBM_AIRT_ANIM_NEXT_FRAME
decides next animation frame
@ CBID_OBJECT_LAND_SLOPE_CHECK
Callback done for each tile of an object to check the slope.
@ CBID_OBJECT_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBM_HOUSE_CARGO_ACCEPTANCE
decides amount of cargo acceptance
@ CBID_VEHICLE_START_STOP_CHECK
Called when the company (or AI) tries to start or stop a vehicle.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
GRFFilePropsBase< 2 > grf_prop
Properties related the the grf file.
static const int CBM_NO_BIT
Mask to show no bit needs to be enabled for the callback.
@ CBID_VEHICLE_VISUAL_EFFECT
Visual effects and wagon power.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBID_VEHICLE_ARTIC_ENGINE
Builds articulated engines for trains and RVs.
@ CBID_HOUSE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
@ CBID_VEHICLE_CARGO_SUFFIX
Determine the cargo "suffixes" for each refit possibility of a cargo.
@ CBM_OBJ_ANIMATION_NEXT_FRAME
decides next animation frame
@ CBID_INDUSTRY_PRODUCTION_CHANGE
Called on production changes, so it can be adjusted.
@ CBID_STATION_AVAILABILITY
Determine whether a newstation should be made available to build.
@ CBID_VEHICLE_MODIFY_PROPERTY
Called to modify various vehicle properties.
static BaseStation * GetByTile(TileIndex tile)
Get the base station belonging to a specific tile.
@ CBID_INDTILE_CARGO_ACCEPTANCE
Called to query the cargo acceptance of the industry tile.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
Representation of the available callbacks with information on when they actually apply.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
@ CBM_INDT_SHAPE_CHECK
decides slope suitability
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
Tindex index
Index of this pool item.
static Object * GetByTile(TileIndex tile)
Get the object associated with a tile.
Resolver object to be used for houses (feature 07 spritegroups).
@ CBM_VEHICLE_SOUND_EFFECT
Vehicle uses custom sound effects.
@ CBID_HOUSE_WATCHED_CARGO_ACCEPTED
Called when a cargo type specified in property 20 is accepted.
IndustryGfx GetIndustryGfx(Tile t)
Get the industry graphics ID for the given industry tile.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
@ CBID_INDUSTRY_PROBABILITY
Called to determine if the given industry type is available.
@ CBM_STATION_SLOPE_CHECK
Check slope of new station tiles.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBID_HOUSE_CUSTOM_NAME
Called on the Get Tile Description for an house tile.
@ CBM_INDT_ACCEPT_CARGO
decides accepted types
static Station * Get(size_t index)
Gets station with given index.
@ CBM_STATION_ANIMATION_NEXT_FRAME
Use a custom next frame callback.
@ CBID_INDTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
DiagDirection GetRoadStopDir(Tile t)
Gets the direction the road stop entrance points towards.
@ CBID_INDTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for industry tile.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
@ CBM_HOUSE_DESTRUCTION
trigger destruction of building
@ CBM_VEHICLE_CARGO_SUFFIX
Show suffix after cargo name.
Defines the internal data of a functional industry.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
@ CBID_HOUSE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for house tile.
@ CBID_STATION_DRAW_TILE_LAYOUT
Choose a tile layout to draw, instead of the standard range.
@ CBID_INDUSTRY_OUTPUT_CARGO_TYPES
Customize the output cargo types of a newly build industry.
@ CBID_INDTILE_ACCEPT_CARGO
Called to determine which cargoes an industry should accept.
@ CBM_VEHICLE_ARTIC_ENGINE
Add articulated engines (trains and road vehicles)
Helper class to wrap some functionality/queries in.
@ CBID_INDUSTRY_SPECIAL_EFFECT
Called to determine industry special effects.
@ CBM_INDT_AUTOSLOPE
decides allowance of autosloping
@ CBM_HOUSE_PRODUCE_CARGO
custom cargo production
@ CBM_IND_FUND_MORE_TEXT
additional text in fund window
Representation of the data from a NewGRF property.
@ CBM_HOUSE_CONSTRUCTION_STATE_CHANGE
change animation when construction state changes
bool PSAWithParameter() const override
Used to decide if the PSA needs a parameter or not.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBID_INDUSTRY_FUND_MORE_TEXT
Called to determine more text in the fund industry window.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
const void * GetInstance(uint index) const override
Get the instance given an index.
@ CBM_IND_PROBABILITY
industry availability/probability callback
@ CBID_VEHICLE_ADDITIONAL_TEXT
This callback is called from vehicle purchase lists.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBM_VEHICLE_NAME
Engine name.
@ CBM_STATION_DRAW_TILE_LAYOUT
Use callback to select a tile layout to use when drawing.
@ CBM_VEHICLE_LENGTH
Vehicle length (trains and road vehicles)
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
@ CBID_INDUSTRY_LOCATION
Called to determine if the given industry can be built on specific area.
@ CBM_HOUSE_ANIMATION_NEXT_FRAME
decides next animation frame
@ CBM_OBJ_FUND_MORE_TEXT
additional text in fund window
@ CBID_HOUSE_COLOUR
Called to determine the colour of a town building.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
@ VSG_SCOPE_SELF
Resolved object itself.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
const void * GetInstance(uint index) const override
Get the instance given an index.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBM_ROAD_STOP_ANIMATION_SPEED
Customize the animation speed of the road stop.
@ CBID_HOUSE_DESTRUCTION
Called periodically to determine if a house should be destroyed.
@ CBM_VEHICLE_LOAD_AMOUNT
Load amount.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
@ CBM_ROAD_STOP_ANIMATION_NEXT_FRAME
Use a custom next frame callback.
TileArea location
Location of the industry.
@ CBID_STATION_LAND_SLOPE_CHECK
Callback done for each tile of a station to check the slope.
@ CBID_STATION_BUILD_TILE_LAYOUT
Called when building a station to customize the tile layout.
static Industry * GetByTile(TileIndex tile)
Get the industry of the given tile.
@ GSF_FAKE_TOWNS
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
@ CBM_STATION_ANIMATION_SPEED
Customize the animation speed of the station.
@ CBID_AIRPTILE_ANIM_NEXT_FRAME
Called to determine airport tile next animation frame.
IndustryType type
type of industry.
@ CBID_VEHICLE_SOUND_EFFECT
Called to play a special sound effect.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
Resolver for industry tiles.
@ CBID_VEHICLE_AUTOREPLACE_SELECTION
Return the vehicles this given vehicle can be "upgraded" to.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBM_IND_PRODUCTION_CHANGE
controls random production change
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
EngineID engine_type
The type of engine used for this vehicle.
static const NIFeature *const _nifeatures[]
Table with all NIFeatures.
Resolver of town properties.
@ NIT_CARGO
The property is a cargo.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBID_HOUSE_ALLOW_CONSTRUCTION
Determine whether the house can be built on the specified tile.
@ CBM_HOUSE_ACCEPT_CARGO
decides accepted types
@ CBID_INDUSTRY_MONTHLYPROD_CHANGE
Called monthly on production changes, so it can be adjusted more frequently.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBID_HOUSE_CONSTRUCTION_STATE_CHANGE
Called whenever the construction state of a house changes.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBM_INDT_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
@ CBM_IND_LOCATION
check industry construction on given area
@ CBM_IND_INPUT_CARGO_TYPES
customize the cargoes the industry requires
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
@ GSF_FAKE_END
End of the fake features.
Airport airport
Tile area the airport covers.
const void * GetInstance(uint) const override
Get the instance given an index.
@ CBID_INDUSTRY_INPUT_CARGO_TYPES
Customize the input cargo types of a newly build industry.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
static const AirportTileSpec * GetByTile(TileIndex tile)
Retrieve airport tile spec for the given airport tile.
void SetObjectAtStringParameters(StringID string, uint32_t index, TileIndex tile) const
Helper to make setting the strings easier for objects at a specific tile.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBM_OBJ_COLOUR
decide the colour of the building
IndustryID GetIndustryIndex(Tile t)
Get the industry ID of the given tile.
@ CBM_HOUSE_COLOUR
decide the colour of the building
@ CBM_HOUSE_ANIMATION_SPEED
decides animation speed
#define lengthof(array)
Return the length of an fixed size array.
Container for all information for a given feature.
@ TCX_NORMAL
Nothing special.
GRFFilePropsBase< NUM_CARGO+3 > grf_prop
Properties related the the grf file.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
Resolver object for airports.
@ INVALID_ROADTYPE
flag for invalid roadtype
@ CBID_HOUSE_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBM_IND_SPECIAL_EFFECT
control special effects
@ CBID_INDUSTRY_CARGO_SUFFIX
Called to determine text to display after cargo name.
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
HouseID GetHouseType(Tile t)
Get the type of this house, which is an index into the house spec array.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBM_STATION_AVAIL
Availability of station in construction window.
@ CBID_STATION_ANIM_NEXT_FRAME
Called to determine station tile next animation frame.
bool IsInspectable(uint) const override
Is the item with the given index inspectable?
@ CBID_HOUSE_CARGO_ACCEPTANCE
Called to decide how much cargo a town building can accept.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
GRFFileProps grf_prop
properties related to the grf file
static uint GetInspectWindowNumber(GrfSpecFeature feature, uint index)
Get the window number for the inspect window given a feature and index.
@ CBM_HOUSE_ANIMATION_START_STOP
periodically start/stop the animation
StationType GetStationType(Tile t)
Get the station type of this tile.
@ CBM_VEHICLE_REFIT_CAPACITY
Cargo capacity after refit.
@ CBM_INDT_ANIM_NEXT_FRAME
decides next animation frame
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
@ CBID_OBJECT_AUTOSLOPE
Called to determine if one can alter the ground below an object tile.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
@ CBM_INDT_ANIM_SPEED
decides animation speed
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
@ CBID_INDTILE_ANIM_NEXT_FRAME
Called to determine industry tile next animation frame.
@ CBID_VEHICLE_COLOUR_MAPPING
Called to determine if a specific colour map should be used for a vehicle instead of the default live...
@ CBM_IND_MONTHLYPROD_CHANGE
controls monthly random production change
@ CBID_INDUSTRY_PROD_CHANGE_BUILD
Called when industry is built to set initial production level.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
Resolver object for road types.
@ CBID_INDUSTRY_REFUSE_CARGO
Called to determine if the industry can still accept or refuse more cargo arrival.
@ CBM_OBJ_SLOPE_CHECK
decides slope suitability
@ CBM_AIRT_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
@ CBID_AIRPTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
const void * GetInstance(uint index) const override
Get the instance given an index.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
@ CBID_AIRPTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for an airport tile.
@ CBM_VEHICLE_VISUAL_EFFECT
Visual effects and wagon power (trains, road vehicles and ships)
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
const void * GetInstance(uint index) const override
Get the instance given an index.
@ CBID_STATION_ANIM_START_STOP
Called for periodically starting or stopping the animation.
const IndustryTileSpec * GetIndustryTileSpec(IndustryGfx gfx)
Accessor for array _industry_tile_specs.
StationID GetStationIndex(Tile t)
Get StationID from a tile.
TileIndex tile
The base tile of the area.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBM_INDT_CARGO_ACCEPTANCE
decides amount of cargo acceptance
@ CBM_OBJ_AUTOSLOPE
decides allowance of autosloping
static HouseSpec * Get(size_t house_id)
Get the spec for a house ID.
struct GRFFileProps grf_prop
Properties related to the grf file.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
void SetSimpleStringParameters(StringID string, uint32_t index) const
Helper to make setting the strings easier.
@ CBM_HOUSE_DENY_DESTRUCTION
conditional protection
StationGfx GetAirportGfx(Tile t)
Get the station graphics of this airport tile.
static const ObjectSpec * GetByTile(TileIndex tile)
Get the specification associated with a tile.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
@ CBM_IND_REFUSE_CARGO
option out of accepting cargo
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
GRFFileProps grf_prop
properties related to the grf file
@ CBID_OBJECT_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
static Station * GetByTile(TileIndex tile)
Get the station belonging to a specific tile.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ CBID_INDTILE_AUTOSLOPE
Called to determine if industry can alter the ground below industry tile.
const void * GetInstance(uint index) const override
Get the instance given an index.
Resolver for a vehicle (chain)
@ CBID_STATION_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBM_IND_WINDOW_MORE_TEXT
additional text in industry window
const void * GetInstance(uint) const override
Get the instance given an index.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBID_OBJECT_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
const void * GetInstance(uint) const override
Get the instance given an index.
@ CBID_HOUSE_PRODUCE_CARGO
Called to determine how much cargo a town building produces.
StorageType storage
Memory for the storage array.
GRFFilePropsBase< NUM_CARGO+3 > grf_prop
Properties related the the grf file.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
@ CBID_VEHICLE_REFIT_CAPACITY
Refit capacity, the passed vehicle needs to have its ->cargo_type set to the cargo we are refitting t...
@ CBID_INDUSTRY_DECIDE_COLOUR
Called to determine the colour of an industry.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
@ CBM_ROAD_STOP_AVAIL
Availability of road stop in construction window.
Representation on the NewGRF variables.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
@ CBID_VEHICLE_32DAY_CALLBACK
Called for every vehicle every 32 days (not all on same date though).
@ CBM_HOUSE_AUTOSLOPE
decides allowance of autosloping
const void * GetInstance(uint) const override
Get the instance given an index.
@ CBID_INDUSTRY_WINDOW_MORE_TEXT
Called to determine more text in the industry window.
@ CBM_IND_DECIDE_COLOUR
give a custom colour to newly build industries
@ CBID_VEHICLE_LOAD_AMOUNT
Determine the amount of cargo to load per unit of time when using gradual loading.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
@ CBID_VEHICLE_LENGTH
Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs.
const IndustrySpec * GetIndustrySpec(IndustryType thistype)
Accessor for array _industry_specs.
@ CBM_IND_PROD_CHANGE_BUILD
initialise production level on construction
Resolver for tiles of an airport.
Resolver object for rail types.
@ CBM_VEHICLE_COLOUR_REMAP
Change colour mapping of vehicle.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
@ CBM_HOUSE_DRAW_FOUNDATIONS
decides if default foundations need to be drawn
VehicleType type
Type of vehicle.
const struct GRFFile * grffile
grf file that introduced this entity
@ CBID_AIRPTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
PersistentStorage * psa
Persistent storage for NewGRF industries.
PersistentStorage * psa
Persistent storage for NewGRF airports.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
@ CBID_INDTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
static const AirportTileSpec * Get(StationGfx gfx)
Retrieve airport tile spec for the given airport tile.
@ CBM_HOUSE_ALLOW_CONSTRUCTION
decide whether the house can be built on a given tile
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
uint8_t type
Type of this airport,.
GRFFileProps grf_prop
properties related the the grf file
@ CBID_HOUSE_DENY_DESTRUCTION
Called to determine whether a town building can be destroyed.
@ CBID_HOUSE_ACCEPT_CARGO
Called to determine which cargoes a town building should accept.
uint8_t layout
Airport layout number.
bool IsInspectable(uint) const override
Is the item with the given index inspectable?
GRFFileProps grf_prop
Properties related the the grf file.
@ CBID_VEHICLE_NAME
Called to determine the engine name to show.
@ CBID_HOUSE_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
@ CBM_IND_OUTPUT_CARGO_TYPES
customize the cargoes the industry produces
static const AirportSpec * Get(uint8_t type)
Retrieve airport spec for the given airport.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
@ CBID_HOUSE_AUTOSLOPE
Called to determine if one can alter the ground below a house tile.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
const void * GetInstance(uint) const override
Get the instance given an index.
bool IsDriveThroughStopTile(Tile t)
Is tile t a drive through road stop station or waypoint?
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
@ CBID_INDTILE_SHAPE_CHECK
Called to determine if the given industry tile can be built on specific tile.
const void * GetInstance(uint) const override
Get the instance given an index.
@ CBID_TRAIN_ALLOW_WAGON_ATTACH
Determine whether a wagon can be attached to an already existing train.
virtual uint32_t GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const
Get a variable value.
@ CBID_OBJECT_FUND_MORE_TEXT
Called to determine more text in the fund object window.
TownID GetTownIndex(Tile t)
Get the index of which town this house/street is attached to.
@ CBM_AIRT_ANIM_SPEED
decides animation speed