OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #ifndef NEWGRF_INDUSTRIES_H
11 #define NEWGRF_INDUSTRIES_H
36 uint32
GetVariable(
byte variable, uint32 parameter,
bool *available)
const override;
38 void StorePSA(uint pos, int32 value)
override;
58 if (tsr !=
nullptr)
return tsr;
uint32 TileIndex
The index/ID of a Tile.
@ INDUSTRY_TRIGGER_CARGO_DELIVERY
Triggered on cargo delivery.
uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile)
Perform an industry callback.
uint32 callback_param1
First parameter (var 10) of the callback.
TileIndex tile
Tile owned by the industry.
uint32 GetTriggers() const override
Get the triggers.
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets, bool grf_version8)
Based on newhouses equivalent, but adapted for newindustries.
TownScopeResolver * GetTown()
Get or create the town scope object associated with the industry.
uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i, uint32 cur_grfid)
Make an analysis of a tile and check for its belonging to the same industry, and/or the same grf file...
@ IACT_RANDOMCREATION
during creation of random ingame industry
void StorePSA(uint pos, int32 value) override
Store a value into the persistent storage area (PSA).
Interface for SpriteGroup-s to access the gamestate.
Industry * industry
Industry being resolved.
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
TownScopeResolver * town_scope
Scope resolver for the associated town (if needed and available, else nullptr).
CallbackID
List of implemented NewGRF callbacks.
@ INDUSTRY_TRIGGER_TILELOOP_PROCESS
Triggered each tile loop.
@ VSG_SCOPE_PARENT
Related object of the resolved one.
Defines the internal data of a functional industry.
Owner
Enum for all companies/owners.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
@ VSG_SCOPE_SELF
Resolved object itself.
uint32 callback_param2
Second parameter (var 18) of the callback.
uint32 random_bits
Random bits of the new industry.
Common return value for all commands.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
Resolver for industry scopes.
IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id)
Map the GRF local type to an industry type.
uint32 GetIndustryProbabilityCallback(IndustryType type, IndustryAvailabilityCallType creation_type, uint32 default_prob)
Check with callback CBID_INDUSTRY_PROBABILITY whether the industry can be built.
bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type)
Check whether an industry temporarily refuses to accept a certain cargo.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Scope resolver for a town.
IndustryAvailabilityCallType
From where has callback CBID_INDUSTRY_PROBABILITY been called.
@ IACT_PROSPECTCREATION
from the Fund/build using prospecting
@ IACT_USERCREATION
from the Fund/build window
uint32 GetRandomBits() const override
Get a few random bits.
@ INDUSTRY_TRIGGER_256_TICKS
Triggered (whole industry) each 256 ticks.
IndustriesScopeResolver(ResolverObject &ro, TileIndex tile, Industry *industry, IndustryType type, uint32 random_bits=0)
Scope resolver for industries.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
@ IACT_MAPGENERATION
during random map generation
CallbackID callback
Callback being resolved.
IndustriesResolverObject(TileIndex tile, Industry *indus, IndustryType type, uint32 random_bits=0, CallbackID callback=CBID_NO_CALLBACK, uint32 callback_param1=0, uint32 callback_param2=0)
Constructor of the industries resolver.
IndustryType type
Type of the industry.
void IndustryProductionCallback(Industry *ind, int reason)
Get the industry production callback and apply it to the industry.
IndustryTrigger
When should the industry(tile) be triggered for random bits?
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
byte CargoID
Cargo slots to indicate a cargo type within a game.
CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, size_t layout, uint32 seed, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
Check that the industry callback allows creation of the industry.
ResolverObject & ro
Surrounding resolver object.
IndustriesScopeResolver industries_scope
Scope resolver for the industry.