12 #ifndef SUBSIDY_BASE_H 13 #define SUBSIDY_BASE_H 63 #define FOR_ALL_SUBSIDIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Subsidy, subsidy_index, var, start) 64 #define FOR_ALL_SUBSIDIES(var) FOR_ALL_SUBSIDIES_FROM(var, 0) static const uint SUBSIDY_CONTRACT_MONTHS
Duration of subsidy after awarding.
basic types related to subsidies
SourceID src
Index of source. Either TownID or IndustryID.
static const uint SUBSIDY_OFFER_MONTHS
Constants related to subsidies.
bool IsAwarded() const
Tests whether this subsidy has been awarded to someone.
SourceID dst
Index of destination. Either TownID or IndustryID.
void AwardTo(CompanyID company)
Marks subsidy as awarded, creates news and AI event.
static const uint SUBSIDY_MAX_PCT_TRANSPORTED
Subsidy will be created only for towns/industries with less % transported.
SourceTypeByte src_type
Source of subsidised path (ST_INDUSTRY or ST_TOWN)
Types related to cargoes...
Defintion of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle...
static const uint SUBSIDY_CARGO_MIN_POPULATION
Min. population of destination town for cargo route.
~Subsidy()
(Empty) destructor has to be defined else operator delete might be called with NULL parameter ...
static const uint SUBSIDY_MAX_DISTANCE
Max. length of subsidised route (DistanceManhattan)
CompanyByte awarded
Subsidy is awarded to this company; INVALID_COMPANY if it's not awarded to anyone.
CargoID cargo_type
Cargo type involved in this subsidy, CT_INVALID for invalid subsidy.
Base class for all PoolItems.
Base class for all pools.
Struct about subsidies, offered and awarded.
Subsidy()
We need an (empty) constructor so struct isn't zeroed (as C++ standard states)
SourceTypeByte dst_type
Destination of subsidised path (ST_INDUSTRY or ST_TOWN)
uint16 SourceID
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
Types related to companies.
byte CargoID
Cargo slots to indicate a cargo type within a game.
Owner
Enum for all companies/owners.
byte remaining
Remaining months when this subsidy is valid.
SubsidyPool _subsidy_pool
Pool for the subsidies.
static const uint SUBSIDY_PAX_MIN_POPULATION
Min. population of towns for subsidised pax route.