37 this->profit_last_year = 0;
39 this->num_vehicle_min_age = 0;
40 this->profit_last_year_min_age = 0;
43 void ClearAutoreplace()
45 this->autoreplace_defined =
false;
46 this->autoreplace_finished =
false;
90 inline bool IsDefaultGroupID(
GroupID index)
113 void RemoveAllGroupsForCompany(
const CompanyID company);
Types related to companies.
Owner
Enum for all companies/owners.
@ INVALID_COMPANY
An invalid company.
Types related to engines.
uint16_t EngineID
Unique identification number of an engine.
Money GetGroupProfitLastYearMinAge(CompanyID company, GroupID id_g, VehicleType type)
Get last year's profit of vehicles above minimum age for the group with GroupID id_g and its sub-grou...
@ GF_REPLACE_PROTECTION
If set to true, the global autoreplace has no effect on the group.
@ GF_REPLACE_WAGON_REMOVAL
If set, autoreplace will perform wagon removal on vehicles in this group.
void UpdateCompanyGroupLiveries(const Company *c)
Update group liveries for a company.
void UpdateTrainGroupID(Train *v)
Recalculates the groupID of a train.
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e)
Get the number of engines with EngineID id_e in the group with GroupID id_g and its sub-groups.
void SetTrainGroupID(Train *v, GroupID grp)
Affect the groupID of a train to new_g.
GroupPool _group_pool
Pool of groups.
bool IsAllGroupID(GroupID id_g)
Checks if a GroupID stands for all vehicles of a company.
uint GetGroupNumVehicle(CompanyID company, GroupID id_g, VehicleType type)
Get the number of vehicles in the group with GroupID id_g and its sub-groups.
uint GetGroupNumVehicleMinAge(CompanyID company, GroupID id_g, VehicleType type)
Get the number of vehicles above profit minimum age in the group with GroupID id_g and its sub-groups...
bool GroupIsInGroup(GroupID search, GroupID group)
Test if GroupID group is a descendant of (or is) GroupID search.
uint16_t GroupID
Type for all group identifiers.
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
static const GroupID ALL_GROUP
All vehicles are in this group.
Functions/types related to livery colours.
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
Statistics and caches on the vehicles in a group.
static void CountVehicle(const Vehicle *v, int delta)
Update num_vehicle when adding or removing a vehicle.
static void AddProfitLastYear(const Vehicle *v)
Add a vehicle's last year profit to the profit sum of its group.
static void VehicleReachedMinAge(const Vehicle *v)
Add a vehicle to the profit sum of its group.
uint16_t GetNumEngines(EngineID engine) const
Get number of vehicles of a specific engine ID.
Money profit_last_year
Sum of profits for all vehicles.
static GroupStatistics & GetAllGroup(const Vehicle *v)
Returns the GroupStatistic for the ALL_GROUPO of a vehicle type.
static void UpdateAfterLoad()
Update all caches after loading a game, changing NewGRF, etc.
static void CountEngine(const Vehicle *v, int delta)
Update num_engines when adding/removing an engine.
uint16_t num_vehicle
Number of vehicles.
Money profit_last_year_min_age
Sum of profits for vehicles considered for profit statistics.
static void UpdateAutoreplace(CompanyID company)
Update autoreplace_defined and autoreplace_finished of all statistics of a company.
static void UpdateProfits()
Recompute the profits for all groups.
void Clear()
Clear all caches.
bool autoreplace_defined
Are any autoreplace rules set?
static GroupStatistics & Get(CompanyID company, GroupID id_g, VehicleType type)
Returns the GroupStatistics for a specific group.
bool autoreplace_finished
Have all autoreplacement finished?
std::map< EngineID, uint16_t > num_engines
Caches the number of engines of each type the company owns.
uint16_t num_vehicle_min_age
Number of vehicles considered for profit statistics;.
Livery livery
Custom colour scheme for vehicles in this group.
GroupID parent
Parent group.
GroupStatistics statistics
NOSAVE: Statistics and caches on the vehicles in the group.
VehicleType vehicle_type
Vehicle type of the group.
bool folded
NOSAVE: Is this group folded in the group view?
std::string name
Group Name.
uint16_t number
Per-company group number.
uint8_t flags
Group flags.
Information about a particular livery.
Base class for all PoolItems.
Base class for all pools.
'Train' is either a loco or a wagon.
Types related to vehicles.
VehicleType
Available vehicle types.