145 void PlantRandomFarmField(
const Industry *i);
151 #define FOR_ALL_INDUSTRIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Industry, industry_index, var, start) 152 #define FOR_ALL_INDUSTRIES(var) FOR_ALL_INDUSTRIES_FROM(var, 0) 164 bool GetIndustryTypeData(IndustryType it);
176 void SetupTargetCount();
177 void TryBuildNewIndustry();
static void ResetIndustryCounts()
Resets industry counts.
void ReleaseDisastersTargetingIndustry(IndustryID)
Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile)...
ProductionLevels
Production level maximum, minimum and default values.
uint16 max_wait
Starting number of turns to wait (copied to wait_count).
basic types related to subsidies
IndustryBuildData _industry_builder
In-game manager of industries.
uint16 counter
used for animation and/or production (if available cargo)
below this level, the industry is set to be closing
static Titem * Get(size_t index)
Returns Titem with given index.
OwnerByte founder
Founder of the industry.
Functionality related to the temporary and persistent storage arrays for NewGRFs. ...
uint16 last_month_production[2]
total units produced per cargo in the last full month
uint16 this_month_transported[2]
stats of this month's transport per cargo
byte selected_layout
Which tile layout was used when creating the industry.
uint8 construction_type
Way the industry was constructed (.
default level set when the industry is created
signal set to actually close the industry
Defines the internal data of a functional industry.
Tindex index
Index of this pool item.
byte was_cargo_delivered
flag that indicate this has been the closest industry chosen for cargo delivery by a station...
uint16 random
Random value used for randomisation of all kinds of things.
static Industry * GetRandom()
Return a random valid industry.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
Accessors for industries.
the industry is running at full speed
uint16 incoming_cargo_waiting[3]
incoming cargo waiting to be processed
byte random_colour
randomized colour of the industry, for display purpose
Date construction_date
Date of the construction of the industry.
Data for managing the number and type of industries in the game.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
PersistentStorage * psa
Persistent storage for NewGRF industries.
uint16 produced_cargo_waiting[2]
amount of cargo produced per cargo
PartOfSubsidyByte part_of_subsidy
NOSAVE: is this industry a source/destination of a subsidy?
bool IsTileForestIndustry(TileIndex tile)
Check whether the tile is a forest.
Year last_prod_year
last year of production
uint16 this_month_production[2]
stats of this month's production per cargo
IndustryType type
type of industry.
CargoID accepts_cargo[3]
3 input cargo slots
TileArea location
Location of the industry.
Represents the covered area of e.g.
Class for pooled persistent storage of data.
static uint16 GetIndustryTypeCount(IndustryType type)
Get the count of industries for this type.
CargoID produced_cargo[2]
2 production cargo slots
byte prod_level
general production level
Data for managing the number of industries of a single industry type.
byte last_month_pct_transported[2]
percentage transported per cargo in the last full month
Base class for all PoolItems.
uint16 last_month_transported[2]
total units transported per cargo in the last full month
uint16 wait_count
Number of turns to wait before trying to build again.
static void IncIndustryTypeCount(IndustryType type)
Increment the count of industries for this type.
Base class for all pools.
static void PostDestructor(size_t index)
Invalidating some stuff after removing item from the pool.
uint32 TileIndex
The index/ID of a Tile.
void RecomputeProductionMultipliers()
Recompute production_rate for current prod_level.
static const IndustryType NUM_INDUSTRYTYPES
total number of industry types, new and old; limited to 240 because we need some special ids like INV...
static IndustryID GetIndustryIndex(TileIndex t)
Get the industry ID of the given tile.
static void DecIndustryTypeCount(IndustryType type)
Decrement the count of industries for this type.
byte production_rate[2]
production rate for each cargo
Type for storing the 'area' of something uses on the map.
uint32 probability
Relative probability of building this industry.
static uint16 counts[NUM_INDUSTRYTYPES]
Number of industries per type ingame.
uint32 wanted_inds
Number of wanted industries (bits 31-16), and a fraction (bits 15-0).
int32 Date
The type to store our dates in.
byte min_number
Smallest number of industries that should exist (either 0 or 1).
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
Date last_cargo_accepted_at
Last day cargo was accepted by this industry.
bool TileBelongsToIndustry(TileIndex tile) const
Check if a given tile belongs to this industry.
byte CargoID
Cargo slots to indicate a cargo type within a game.
static Industry * GetByTile(TileIndex tile)
Get the industry of the given tile.
uint16 target_count
Desired number of industries of this type.
OwnerByte owner
owner of the industry. Which SHOULD always be (imho) OWNER_NONE