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 }
19#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 }
22#define NIV(var, name) { name, var }
27#define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit)
48 NIV(0x40,
"position in consist and length"),
49 NIV(0x41,
"position and length of chain of same vehicles"),
50 NIV(0x42,
"transported cargo types"),
51 NIV(0x43,
"player info"),
52 NIV(0x44,
"aircraft info"),
53 NIV(0x45,
"curvature info"),
54 NIV(0x46,
"motion counter"),
55 NIV(0x47,
"vehicle cargo info"),
56 NIV(0x48,
"vehicle type info"),
57 NIV(0x49,
"year of construction"),
58 NIV(0x4A,
"current rail/road type info"),
59 NIV(0x4B,
"long date of last service"),
60 NIV(0x4C,
"current max speed"),
61 NIV(0x4D,
"position in articulated vehicle"),
62 NIV(0x60,
"count vehicle id occurrences"),
64 NIV(0x62,
"curvature/position difference to other vehicle"),
65 NIV(0x63,
"tile compatibility wrt. track-type"),
76 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
88 std::make_unique<NIHVehicle>(),
94#define NICS(cb_id, bit) NIC(cb_id, StationSpec, callback_mask, bit)
106 NIV(0x40,
"platform info and relative position"),
107 NIV(0x41,
"platform info and relative position for individually built sections"),
108 NIV(0x42,
"terrain and track type"),
109 NIV(0x43,
"player info"),
110 NIV(0x44,
"path signalling info"),
111 NIV(0x45,
"rail continuation info"),
112 NIV(0x46,
"platform info and relative position from middle"),
113 NIV(0x47,
"platform info and relative position from middle for individually built sections"),
114 NIV(0x48,
"bitmask of accepted cargoes"),
115 NIV(0x49,
"platform info and relative position of same-direction section"),
116 NIV(0x4A,
"current animation frame"),
117 NIV(0x60,
"amount of cargo waiting"),
118 NIV(0x61,
"time since last cargo pickup"),
119 NIV(0x62,
"rating of cargo"),
120 NIV(0x63,
"time spent on route"),
121 NIV(0x64,
"information about last vehicle picking cargo up"),
122 NIV(0x65,
"amount of cargo acceptance"),
123 NIV(0x66,
"animation frame of nearby tile"),
124 NIV(0x67,
"land info of nearby tiles"),
125 NIV(0x68,
"station info of nearby tiles"),
126 NIV(0x69,
"information about cargo accepted in the past"),
127 NIV(0x6A,
"GRFID of nearby station tiles"),
128 NIV(0x6B,
"station ID of nearby tiles"),
135 const void *
GetSpec(uint index)
const override {
return GetStationSpec(
TileIndex{index}); }
139 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
151 std::make_unique<NIHStation>(),
157#define NICH(cb_id, bit) NIC(cb_id, HouseSpec, callback_mask, bit)
177 NIV(0x40,
"construction state of tile and pseudo-random value"),
178 NIV(0x41,
"age of building in years"),
179 NIV(0x42,
"town zone"),
180 NIV(0x43,
"terrain type"),
181 NIV(0x44,
"building counts"),
182 NIV(0x45,
"town expansion bits"),
183 NIV(0x46,
"current animation frame"),
184 NIV(0x47,
"xy coordinate of the building"),
185 NIV(0x60,
"other building counts (old house type)"),
186 NIV(0x61,
"other building counts (new house type)"),
187 NIV(0x62,
"land info of nearby tiles"),
188 NIV(0x63,
"current animation frame of nearby house tile"),
189 NIV(0x64,
"cargo acceptance history of nearby stations"),
190 NIV(0x65,
"distance of nearest house matching a given criterion"),
191 NIV(0x66,
"class and ID of nearby house tile"),
192 NIV(0x67,
"GRFID of nearby house tile"),
203 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
215 std::make_unique<NIHHouse>(),
221#define NICIT(cb_id, bit) NIC(cb_id, IndustryTileSpec, callback_mask, bit)
222static const NICallback _nic_industrytiles[] = {
233static const NIVariable _niv_industrytiles[] = {
234 NIV(0x40,
"construction state of tile"),
235 NIV(0x41,
"ground type"),
236 NIV(0x42,
"current town zone in nearest town"),
237 NIV(0x43,
"relative position"),
238 NIV(0x44,
"animation frame"),
239 NIV(0x60,
"land info of nearby tiles"),
240 NIV(0x61,
"animation stage of nearby tiles"),
241 NIV(0x62,
"get industry or airport tile ID at offset"),
252 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
260static const NIFeature _nif_industrytile = {
264 std::make_unique<NIHIndustryTile>(),
269#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(CargoType), prop, type }
270#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(CargoType), prop, type }
307#undef NIP_PRODUCED_CARGO
308#undef NIP_ACCEPTED_CARGO
310#define NICI(cb_id, bit) NIC(cb_id, IndustrySpec, callback_mask, bit)
328 NIV(0x40,
"waiting cargo 0"),
329 NIV(0x41,
"waiting cargo 1"),
330 NIV(0x42,
"waiting cargo 2"),
331 NIV(0x43,
"distance to closest dry/land tile"),
332 NIV(0x44,
"layout number"),
333 NIV(0x45,
"player info"),
334 NIV(0x46,
"industry construction date"),
335 NIV(0x60,
"get industry tile ID at offset"),
336 NIV(0x61,
"get random tile bits at offset"),
337 NIV(0x62,
"land info of nearby tiles"),
338 NIV(0x63,
"animation stage of nearby tiles"),
339 NIV(0x64,
"distance on nearest industry with given type"),
340 NIV(0x65,
"get town zone and Manhattan distance of closest town"),
341 NIV(0x66,
"get square of Euclidean distance of closes town"),
342 NIV(0x67,
"count of industry and distance of closest instance"),
343 NIV(0x68,
"count of industry and distance of closest instance with layout filter"),
344 NIV(0x69,
"produced cargo waiting"),
345 NIV(0x6A,
"cargo produced this month"),
346 NIV(0x6B,
"cargo transported this month"),
347 NIV(0x6C,
"cargo produced last month"),
348 NIV(0x6D,
"cargo transported last month"),
349 NIV(0x6E,
"date since cargo was delivered"),
350 NIV(0x6F,
"waiting input cargo"),
351 NIV(0x70,
"production rate"),
352 NIV(0x71,
"percentage of cargo transported last month"),
363 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
370 const std::span<int32_t>
GetPSA(uint index, uint32_t)
const override
373 if (i->
psa ==
nullptr)
return {};
382 std::make_unique<NIHIndustry>(),
388#define NICO(cb_id, bit) NIC(cb_id, ObjectSpec, callback_mask, bit)
400 NIV(0x40,
"relative position"),
401 NIV(0x41,
"tile information"),
402 NIV(0x42,
"construction date"),
403 NIV(0x43,
"animation counter"),
404 NIV(0x44,
"object founder"),
405 NIV(0x45,
"get town zone and Manhattan distance of closest town"),
406 NIV(0x46,
"get square of Euclidean distance of closes town"),
409 NIV(0x60,
"get object ID at offset"),
410 NIV(0x61,
"get random tile bits at offset"),
411 NIV(0x62,
"land info of nearby tiles"),
412 NIV(0x63,
"animation stage of nearby tiles"),
413 NIV(0x64,
"distance on nearest object with given type"),
424 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
436 std::make_unique<NIHObject>(),
443 NIV(0x40,
"terrain type"),
444 NIV(0x41,
"enhanced tunnels"),
445 NIV(0x42,
"level crossing status"),
446 NIV(0x43,
"construction date"),
447 NIV(0x44,
"town zone"),
452 uint
GetParent(uint)
const override {
return UINT32_MAX; }
454 const void *
GetSpec(uint)
const override {
return nullptr; }
456 uint32_t
GetGRFID(uint)
const override {
return 0; }
458 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
471 std::make_unique<NIHRailType>(),
477#define NICAT(cb_id, bit) NIC(cb_id, AirportTileSpec, callback_mask, bit)
478static const NICallback _nic_airporttiles[] = {
493 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
501static const NIFeature _nif_airporttile = {
505 std::make_unique<NIHAirportTile>(),
512 NIV(0x40,
"Layout number"),
513 NIV(0x48,
"bitmask of accepted cargoes"),
514 NIV(0x60,
"amount of cargo waiting"),
515 NIV(0x61,
"time since last cargo pickup"),
516 NIV(0x62,
"rating of cargo"),
517 NIV(0x63,
"time spent on route"),
518 NIV(0x64,
"information about last vehicle picking cargo up"),
519 NIV(0x65,
"amount of cargo acceptance"),
520 NIV(0x69,
"information about cargo accepted in the past"),
521 NIV(0xF1,
"type of the airport"),
522 NIV(0xF6,
"airport block status"),
523 NIV(0xFA,
"built date"),
534 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
541 const std::span<int32_t>
GetPSA(uint index, uint32_t)
const override
553 std::make_unique<NIHAirport>(),
560 NIV(0x40,
"larger town effect on this town"),
561 NIV(0x41,
"town index"),
562 NIV(0x82,
"population"),
563 NIV(0x94,
"zone radius 0"),
564 NIV(0x96,
"zone radius 1"),
565 NIV(0x98,
"zone radius 2"),
566 NIV(0x9A,
"zone radius 3"),
567 NIV(0x9C,
"zone radius 4"),
568 NIV(0xB6,
"number of buildings"),
573 uint
GetParent(uint)
const override {
return UINT32_MAX; }
575 const void *
GetSpec(uint)
const override {
return nullptr; }
577 uint32_t
GetGRFID(uint)
const override {
return 0; }
580 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
586 const std::span<int32_t>
GetPSA(uint index, uint32_t grfid)
const override
590 for (
const auto &it : t->psa_list) {
591 if (it->grfid == grfid)
return it->storage;
602 std::make_unique<NIHTown>(),
608 NIV(0x40,
"terrain type"),
609 NIV(0x41,
"enhanced tunnels"),
610 NIV(0x42,
"level crossing status"),
611 NIV(0x43,
"construction date"),
612 NIV(0x44,
"town zone"),
617 uint
GetParent(uint)
const override {
return UINT32_MAX; }
619 const void *
GetSpec(uint)
const override {
return nullptr; }
621 uint32_t
GetGRFID(uint)
const override {
return 0; }
623 uint
Resolve(uint index, uint var, uint param,
bool &avail)
const override
636 std::make_unique<NIHRoadType>(),
643 std::make_unique<NIHRoadType>(),
646#define NICRS(cb_id, bit) NIC(cb_id, RoadStopSpec, callback_mask, bit)
655 NIV(0x40,
"view/rotation"),
656 NIV(0x41,
"stop type"),
657 NIV(0x42,
"terrain type"),
658 NIV(0x43,
"road type"),
659 NIV(0x44,
"tram type"),
660 NIV(0x45,
"town zone and Manhattan distance of town"),
661 NIV(0x46,
"square of Euclidean distance of town"),
662 NIV(0x47,
"player info"),
663 NIV(0x48,
"bitmask of accepted cargoes"),
664 NIV(0x49,
"current animation frame"),
665 NIV(0x60,
"amount of cargo waiting"),
666 NIV(0x61,
"time since last cargo pickup"),
667 NIV(0x62,
"rating of cargo"),
668 NIV(0x63,
"time spent on route"),
669 NIV(0x64,
"information about last vehicle picking cargo up"),
670 NIV(0x65,
"amount of cargo acceptance"),
671 NIV(0x66,
"animation frame of nearby tile"),
672 NIV(0x67,
"land info of nearby tiles"),
673 NIV(0x68,
"road stop info of nearby tiles"),
674 NIV(0x69,
"information about cargo accepted in the past"),
675 NIV(0x6A,
"GRFID of nearby road stop tiles"),
676 NIV(0x6B,
"road stop ID of nearby tiles"),
683 const void *
GetSpec(uint index)
const override {
return GetRoadStopSpec(
TileIndex{index}); }
687 uint Resolve(uint index, uint var, uint32_t param,
bool &avail)
const override
692 return ro.GetScope(
VSG_SCOPE_SELF)->GetVariable(var, param, avail);
700 std::make_unique<NIHRoadStop>(),
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
const void * GetInstance(uint) 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.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
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.
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.
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?
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
const std::span< int32_t > GetPSA(uint index, uint32_t) const override
Gets the span containing the persistent storage.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
const void * GetInstance(uint) const override
Get the instance given an index.
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.
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?
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
const void * GetInstance(uint) 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.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
const std::span< int32_t > GetPSA(uint index, uint32_t) const override
Gets the span containing the persistent storage.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
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.
const void * GetSpec(uint index) const override
Get (NewGRF) specs given an index.
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.
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.
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
bool IsInspectable(uint) const override
Is the item with the given index inspectable?
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
const void * GetInstance(uint) const override
Get the instance given an index.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
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.
const void * GetInstance(uint) const override
Get the instance given an index.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
const void * GetInstance(uint) const override
Get the instance given an index.
bool IsInspectable(uint) const override
Is the item with the given index inspectable?
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
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.
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.
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.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
uint32_t GetGRFID(uint index) const override
Get the GRFID of the file that includes this item.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
uint32_t GetGRFID(uint) const override
Get the GRFID of the file that includes this item.
uint Resolve(uint index, uint var, uint param, bool &avail) const override
Resolve (action2) variable for a given index.
bool PSAWithParameter() const override
Used to decide if the PSA needs a parameter or not.
const void * GetSpec(uint) const override
Get (NewGRF) specs given an index.
const void * GetInstance(uint index) const override
Get the instance given an index.
void SetStringParameters(uint index) const override
Set the string parameters to write the right data for a STRINGn.
uint GetParent(uint) const override
Get the parent "window_number" of a given instance.
const std::span< int32_t > GetPSA(uint index, uint32_t grfid) const override
Gets the span containing the persistent storage.
bool IsInspectable(uint index) const override
Is the item with the given index inspectable?
uint GetParent(uint index) const override
Get the parent "window_number" of a given instance.
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.
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 * 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.
Helper class to wrap some functionality/queries in.
void SetSimpleStringParameters(StringID string, uint32_t index) const
Helper to make setting the strings easier.
void SetObjectAtStringParameters(StringID string, uint32_t index, TileIndex tile) const
Helper to make setting the strings easier for objects at a specific tile.
const IndustrySpec * GetIndustrySpec(IndustryType thistype)
Accessor for array _industry_specs.
const IndustryTileSpec * GetIndustryTileSpec(IndustryGfx gfx)
Accessor for array _industry_tile_specs.
IndustryGfx GetIndustryGfx(Tile t)
Get the industry graphics ID for the given industry tile.
IndustryID GetIndustryIndex(Tile t)
Get the industry ID of the given tile.
@ GSF_FAKE_TOWNS
Fake town GrfSpecFeature for NewGRF debugging (parent scope)
@ GSF_FAKE_END
End of the fake features.
uint8_t StationGfx
Copy from station_map.h.
@ DrawFoundations
decides if default foundations need to be drawn
@ AnimationNextFrame
decides next animation frame
@ AnimationSpeed
decides animation speed
@ DrawTileLayout
Use callback to select a tile layout to use when drawing.
@ Avail
Availability of station in construction window.
@ AnimationNextFrame
Use a custom next frame callback.
@ AnimationSpeed
Customize the animation speed of the station.
@ SlopeCheck
Check slope of new station tiles.
@ VisualEffect
Visual effects and wagon power (trains, road vehicles and ships)
@ SoundEffect
Vehicle uses custom sound effects.
@ RefitCapacity
Cargo capacity after refit.
@ ArticEngine
Add articulated engines (trains and road vehicles)
@ Length
Vehicle length (trains and road vehicles)
@ ColourRemap
Change colour mapping of vehicle.
@ CargoSuffix
Show suffix after cargo name.
@ Probability
industry availability/probability callback
@ WindowMoreText
additional text in industry window
@ FundMoreText
additional text in fund window
@ InputCargoTypes
customize the cargoes the industry requires
@ ProductionChange
controls random production change
@ DecideColour
give a custom colour to newly build industries
@ SpecialEffect
control special effects
@ ProdChangeBuild
initialise production level on construction
@ Location
check industry construction on given area
@ MonthlyProdChange
controls monthly random production change
@ CargoSuffix
cargo sub-type display
@ RefuseCargo
option out of accepting cargo
@ OutputCargoTypes
customize the cargoes the industry produces
@ CBID_HOUSE_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
@ CBID_INDUSTRY_OUTPUT_CARGO_TYPES
Customize the output cargo types of a newly build industry.
@ CBID_VEHICLE_SOUND_EFFECT
Called to play a special sound effect.
@ CBID_INDTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBID_INDTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
@ CBID_OBJECT_FUND_MORE_TEXT
Called to determine more text in the fund object window.
@ CBID_INDUSTRY_SPECIAL_EFFECT
Called to determine industry special effects.
@ CBID_INDTILE_ANIM_NEXT_FRAME
Called to determine industry tile next animation frame.
@ CBID_INDUSTRY_PROBABILITY
Called to determine if the given industry type is available.
@ CBID_INDTILE_SHAPE_CHECK
Called to determine if the given industry tile can be built on specific tile.
@ CBID_AIRPTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for an airport tile.
@ CBID_INDTILE_AUTOSLOPE
Called to determine if industry can alter the ground below industry tile.
@ CBID_VEHICLE_AUTOREPLACE_SELECTION
Return the vehicles this given vehicle can be "upgraded" to.
@ CBID_STATION_BUILD_TILE_LAYOUT
Called when building a station to customize the tile layout.
@ CBID_HOUSE_CONSTRUCTION_STATE_CHANGE
Called whenever the construction state of a house changes.
@ CBID_VEHICLE_COLOUR_MAPPING
Called to determine if a specific colour map should be used for a vehicle instead of the default live...
@ CBID_INDUSTRY_DECIDE_COLOUR
Called to determine the colour of an industry.
@ CBID_INDUSTRY_WINDOW_MORE_TEXT
Called to determine more text in the industry window.
@ CBID_VEHICLE_32DAY_CALLBACK
Called for every vehicle every 32 days (not all on same date though).
@ CBID_OBJECT_LAND_SLOPE_CHECK
Callback done for each tile of an object to check the slope.
@ CBID_VEHICLE_NAME
Called to determine the engine name to show.
@ CBID_STATION_DRAW_TILE_LAYOUT
Choose a tile layout to draw, instead of the standard range.
@ CBID_VEHICLE_CARGO_SUFFIX
Determine the cargo "suffixes" for each refit possibility of a cargo.
@ CBID_HOUSE_COLOUR
Called to determine the colour of a town building.
@ CBID_HOUSE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for house tile.
@ CBID_AIRPTILE_ANIM_START_STOP
Called for periodically starting or stopping the animation.
@ CBID_INDTILE_DRAW_FOUNDATIONS
Called to determine the type (if any) of foundation to draw for industry tile.
@ CBID_INDUSTRY_PRODUCTION_CHANGE
Called on production changes, so it can be adjusted.
@ CBID_INDUSTRY_CARGO_SUFFIX
Called to determine text to display after cargo name.
@ CBID_OBJECT_AUTOSLOPE
Called to determine if one can alter the ground below an object tile.
@ CBID_HOUSE_CARGO_ACCEPTANCE
Called to decide how much cargo a town building can accept.
@ CBID_VEHICLE_LENGTH
Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs.
@ CBID_HOUSE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBID_HOUSE_AUTOSLOPE
Called to determine if one can alter the ground below a house tile.
@ CBID_AIRPTILE_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBID_OBJECT_ANIMATION_START_STOP
Called for periodically starting or stopping the animation.
@ CBID_INDUSTRY_REFUSE_CARGO
Called to determine if the industry can still accept or refuse more cargo arrival.
@ CBID_STATION_AVAILABILITY
Determine whether a newstation should be made available to build.
@ CBID_HOUSE_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
@ CBID_HOUSE_CUSTOM_NAME
Called on the Get Tile Description for an house tile.
@ CBID_INDUSTRY_MONTHLYPROD_CHANGE
Called monthly on production changes, so it can be adjusted more frequently.
@ CBID_HOUSE_DENY_DESTRUCTION
Called to determine whether a town building can be destroyed.
@ CBID_VEHICLE_START_STOP_CHECK
Called when the company (or AI) tries to start or stop a vehicle.
@ CBID_STATION_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBID_HOUSE_ALLOW_CONSTRUCTION
Determine whether the house can be built on the specified tile.
@ CBID_INDUSTRY_FUND_MORE_TEXT
Called to determine more text in the fund industry window.
@ CBID_HOUSE_WATCHED_CARGO_ACCEPTED
Called when a cargo type specified in property 20 is accepted.
@ CBID_HOUSE_ACCEPT_CARGO
Called to determine which cargoes a town building should accept.
@ CBID_OBJECT_ANIMATION_NEXT_FRAME
Determine the next animation frame for a house.
@ CBID_TRAIN_ALLOW_WAGON_ATTACH
Determine whether a wagon can be attached to an already existing train.
@ CBID_HOUSE_PRODUCE_CARGO
Called to determine how much cargo a town building produces.
@ CBID_VEHICLE_MODIFY_PROPERTY
Called to modify various vehicle properties.
@ CBID_OBJECT_COLOUR
Called to determine the colour of a town building.
@ CBID_STATION_ANIM_START_STOP
Called for periodically starting or stopping the animation.
@ CBID_VEHICLE_ADDITIONAL_TEXT
This callback is called from vehicle purchase lists.
@ CBID_VEHICLE_REFIT_CAPACITY
Refit capacity, the passed vehicle needs to have its ->cargo_type set to the cargo we are refitting t...
@ CBID_OBJECT_ANIMATION_SPEED
Called to indicate how long the current animation frame should last.
@ CBID_STATION_LAND_SLOPE_CHECK
Callback done for each tile of a station to check the slope.
@ CBID_VEHICLE_LOAD_AMOUNT
Determine the amount of cargo to load per unit of time when using gradual loading.
@ CBID_HOUSE_DESTRUCTION
Called periodically to determine if a house should be destroyed.
@ CBID_VEHICLE_VISUAL_EFFECT
Visual effects and wagon power.
@ CBID_INDUSTRY_PROD_CHANGE_BUILD
Called when industry is built to set initial production level.
@ CBID_INDTILE_CARGO_ACCEPTANCE
Called to query the cargo acceptance of the industry tile.
@ CBID_INDUSTRY_LOCATION
Called to determine if the given industry can be built on specific area.
@ CBID_INDTILE_ACCEPT_CARGO
Called to determine which cargoes an industry should accept.
@ CBID_STATION_ANIM_NEXT_FRAME
Called to determine station tile next animation frame.
@ CBID_VEHICLE_ARTIC_ENGINE
Builds articulated engines for trains and RVs.
@ CBID_AIRPTILE_ANIM_NEXT_FRAME
Called to determine airport tile next animation frame.
@ CBID_INDUSTRY_INPUT_CARGO_TYPES
Customize the input cargo types of a newly build industry.
@ FundMoreText
additional text in fund window
@ Autoslope
decides allowance of autosloping
@ AnimationNextFrame
decides next animation frame
@ AnimationSpeed
decides animation speed
@ Colour
decide the colour of the building
@ SlopeCheck
decides slope suitability
@ Avail
Availability of road stop in construction window.
@ AnimationNextFrame
Use a custom next frame callback.
@ AnimationSpeed
Customize the animation speed of the road stop.
@ ShapeCheck
decides slope suitability
@ AcceptCargo
decides accepted types
@ CargoAcceptance
decides amount of cargo acceptance
@ DrawFoundations
decides if default foundations need to be drawn
@ Autoslope
decides allowance of autosloping
@ AnimationNextFrame
decides next animation frame
@ AnimationSpeed
decides animation speed
@ AllowConstruction
decide whether the house can be built on a given tile
@ AcceptCargo
decides accepted types
@ Destruction
trigger destruction of building
@ AnimationStartStop
periodically start/stop the animation
@ CargoAcceptance
decides amount of cargo acceptance
@ DrawFoundations
decides if default foundations need to be drawn
@ ProduceCargo
custom cargo production
@ Autoslope
decides allowance of autosloping
@ AnimationNextFrame
decides next animation frame
@ DenyDestruction
conditional protection
@ AnimationSpeed
decides animation speed
@ ConstructionStateChange
change animation when construction state changes
@ Colour
decide the colour of the building
@ TCX_NORMAL
Nothing special.
GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
Get the GrfSpecFeature associated with the tile.
static const NIFeature *const _nifeatures[]
Table with all NIFeatures.
static uint GetInspectWindowNumber(GrfSpecFeature feature, uint index)
Get the window number for the inspect window given a feature and index.
@ NIT_CARGO
The property is a cargo.
@ VSG_SCOPE_SELF
Resolved object itself.
@ INVALID_ROADTYPE
flag for invalid roadtype
StationType GetStationType(Tile t)
Get the station type of this tile.
StationGfx GetStationGfx(Tile t)
Get the station graphics of this tile.
StationID GetStationIndex(Tile t)
Get StationID from a tile.
StationGfx GetAirportGfx(Tile t)
Get the station graphics of this airport tile.
#define lengthof(array)
Return the length of an fixed size array.
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
Resolver object for airports.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
struct GRFFileProps grf_prop
Properties related to the grf file.
static const AirportSpec * Get(uint8_t type)
Retrieve airport spec for the given airport.
Resolver for tiles of an airport.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
static const AirportTileSpec * Get(StationGfx gfx)
Retrieve airport tile spec for the given airport tile.
static const AirportTileSpec * GetByTile(TileIndex tile)
Retrieve airport tile spec for the given airport tile.
GRFFileProps grf_prop
properties related the the grf file
uint8_t type
Type of this airport,.
PersistentStorage * psa
Persistent storage for NewGRF airports.
uint8_t layout
Airport layout number.
static BaseStation * GetByTile(TileIndex tile)
Get the base station belonging to a specific tile.
VehicleType type
Type of vehicle.
bool HasGrfFile() const
Test if this entity was introduced by NewGRF.
uint32_t grfid
grfid that introduced this entity.
Resolver object to be used for houses (feature 07 spritegroups).
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
static HouseSpec * Get(size_t house_id)
Get the spec for a house ID.
GRFFileProps grf_prop
Properties related the the grf file.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
GRFFileProps grf_prop
properties related to the grf file
Resolver for industry tiles.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
GRFFileProps grf_prop
properties related to the grf file
Defines the internal data of a functional industry.
IndustryType type
type of industry.
PersistentStorage * psa
Persistent storage for NewGRF industries.
static Industry * GetByTile(TileIndex tile)
Get the industry of the given tile.
TileArea location
Location of the industry.
Representation of the available callbacks with information on when they actually apply.
Container for all information for a given feature.
Representation of the data from a NewGRF property.
Representation on the NewGRF variables.
A resolver object to be used with feature 0F spritegroups.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
static const ObjectSpec * GetByTile(TileIndex tile)
Get the specification associated with a tile.
static Object * GetByTile(TileIndex tile)
Get the object associated with a tile.
TileIndex tile
The base tile of the area.
StorageType storage
Memory for the storage array.
Tindex index
Index of this pool item.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-nullptr) Titem.
static Titem * Get(size_t index)
Returns Titem with given index.
Resolver object for rail types.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
Resolver object for road types.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
virtual uint32_t GetVariable(uint8_t variable, uint32_t parameter, bool &available) const
Get a variable value.
static Station * Get(size_t index)
Gets station with given index.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
Airport airport
Tile area the airport covers.
Resolver of town properties.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
Resolver for a vehicle (chain)
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
@ WO_CACHED
Resolve wagon overrides using TrainCache::cached_override.
EngineID engine_type
The type of engine used for this vehicle.
Vehicle * First() const
Get the first vehicle of this vehicle chain.
HouseID GetHouseType(Tile t)
Get the type of this house, which is an index into the house spec array.
TownID GetTownIndex(Tile t)
Get the index of which town this house/street is attached to.