OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
42 this->num_profit_vehicle = 0;
43 this->profit_last_year = 0;
46 void ClearAutoreplace()
48 this->autoreplace_defined =
false;
49 this->autoreplace_finished =
false;
89 static inline bool IsDefaultGroupID(
GroupID index)
113 void RemoveAllGroupsForCompany(
const CompanyID company);
void SetTrainGroupID(Train *v, GroupID grp)
Affect the groupID of a train to new_g.
GroupPool _group_pool
Pool of groups.
@ GF_REPLACE_PROTECTION
If set to true, the global autoreplace has no effect on the group.
static void CountEngine(const Vehicle *v, int delta)
Update num_engines when adding/removing an engine.
GroupID parent
Parent group.
static void CountVehicle(const Vehicle *v, int delta)
Update num_vehicle when adding or removing a vehicle.
bool autoreplace_finished
Have all autoreplacement finished?
Livery livery
Custom colour scheme for vehicles in this group.
Money profit_last_year
Sum of profits for all vehicles.
Owner
Enum for all companies/owners.
VehicleType vehicle_type
Vehicle type of the group.
uint16 num_vehicle
Number of vehicles.
static const GroupID ALL_GROUP
All vehicles are in this group.
void RemoveVehicleFromGroup(const Vehicle *v)
Decrease the num_vehicle variable before delete an front engine from a group.
Statistics and caches on the vehicles in a group.
uint16 EngineID
Unique identification number of an engine.
void UpdateTrainGroupID(Train *v)
Recalculates the groupID of a train.
GroupStatistics statistics
NOSAVE: Statistics and caches on the vehicles in the group.
static void UpdateAutoreplace(CompanyID company)
Update autoreplace_defined and autoreplace_finished of all statistics of a company.
'Train' is either a loco or a wagon.
static GroupStatistics & Get(CompanyID company, GroupID id_g, VehicleType type)
Returns the GroupStatistics for a specific group.
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
uint16 * num_engines
Caches the number of engines of each type the company owns.
static GroupStatistics & GetAllGroup(const Vehicle *v)
Returns the GroupStatistic for the ALL_GROUPO of a vehicle type.
static void VehicleReachedProfitAge(const Vehicle *v)
Add a vehicle to the profit sum of its group.
static bool IsAllGroupID(GroupID id_g)
Checks if a GroupID stands for all vehicles of a company.
VehicleType
Available vehicle types.
bool autoreplace_defined
Are any autoreplace rules set?
uint GetGroupNumProfitVehicle(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...
Base class for all pools.
uint16 GroupID
Type for all group identifiers.
static void UpdateProfits()
Recompute the profits for all groups.
std::string name
Group Name.
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 Clear()
Clear all caches.
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.
bool folded
NOSAVE: Is this group folded in the group view?
@ INVALID_COMPANY
An invalid company.
@ GF_REPLACE_WAGON_REMOVAL
If set, autoreplace will perform wagon removal on vehicles in this group.
Base class for all PoolItems.
Information about a particular livery.
static void UpdateAfterLoad()
Update all caches after loading a game, changing NewGRF, etc.
uint16 num_profit_vehicle
Number of vehicles considered for profit statistics;.
Money GetGroupProfitLastYear(CompanyID company, GroupID id_g, VehicleType type)
Get last year's profit for 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.