OpenTTD Source 20250312-master-gcdcc6b491d
|
#include <group.h>
Public Member Functions | |
Group (CompanyID owner, VehicleType vehicle_type) | |
![]() | |
void * | operator new (size_t size) |
Allocates space for new Titem. | |
void * | operator new (size_t size, Tindex index) |
Allocates space for new Titem with given index. | |
void * | operator new (size_t, void *ptr) |
Allocates space for new Titem at given memory address. | |
void | operator delete (void *p, size_t size) |
Marks Titem as free. | |
Data Fields | |
std::string | name {} |
Group Name. | |
Owner | owner = INVALID_OWNER |
Group Owner. | |
VehicleType | vehicle_type = VEH_INVALID |
Vehicle type of the group. | |
GroupFlags | flags {} |
Group flags. | |
Livery | livery {} |
Custom colour scheme for vehicles in this group. | |
GroupStatistics | statistics {} |
NOSAVE: Statistics and caches on the vehicles in the group. | |
bool | folded = false |
NOSAVE: Is this group folded in the group view? | |
GroupID | parent = GroupID::Invalid() |
Parent group. | |
uint16_t | number = 0 |
Per-company group number. | |
![]() | |
Tindex | index |
Index of this pool item. | |
Additional Inherited Members | |
![]() | |
typedef struct Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache > | Pool |
Type of the pool this item is going to be part of. | |
![]() | |
static bool | CanAllocateItem (size_t n=1) |
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() | |
static bool | CleaningPool () |
Returns current state of pool cleaning - yes or no. | |
static bool | IsValidID (auto index) |
Tests whether given index can be used to get valid (non-nullptr) Titem. | |
static Titem * | Get (auto index) |
Returns Titem with given index. | |
static Titem * | GetIfValid (auto index) |
Returns Titem with given index. | |
static size_t | GetPoolSize () |
Returns first unused index. | |
static size_t | GetNumItems () |
Returns number of valid items in the pool. | |
static void | PostDestructor (size_t index) |
Dummy function called after destructor of each member. | |
static Pool::IterateWrapper< Titem > | Iterate (size_t from=0) |
Returns an iterable ensemble of all valid Titem. | |
|
inline |
GroupFlags Group::flags {} |
Group flags.
Definition at line 77 of file group.h.
Referenced by CmdAutoreplaceVehicle(), CmdCreateGroup(), VehicleGroupWindow::DrawWidget(), ReplaceVehicleWindow::OnClick(), VehicleGroupWindow::OnClick(), and SetGroupFlag().
bool Group::folded = false |
NOSAVE: Is this group folded in the group view?
Definition at line 81 of file group.h.
Referenced by VehicleGroupWindow::DrawWidget().
Livery Group::livery {} |
Custom colour scheme for vehicles in this group.
Definition at line 78 of file group.h.
Referenced by CmdAlterGroup(), CmdCreateGroup(), CmdSetGroupLivery(), SelectCompanyLiveryWindow::DrawWidget(), GetEngineLivery(), SelectCompanyLiveryWindow::GetWidgetString(), PropagateChildLivery(), and UpdateCompanyGroupLiveries().
std::string Group::name {} |
Group Name.
Definition at line 73 of file group.h.
Referenced by CmdAlterGroup(), and FormatString().
uint16_t Group::number = 0 |
Per-company group number.
Definition at line 84 of file group.h.
Referenced by BuildGuiGroupList(), CmdCreateGroup(), CmdDeleteGroup(), and FormatString().
Owner Group::owner = INVALID_OWNER |
Group Owner.
Definition at line 74 of file group.h.
Referenced by CmdAddVehicleGroup(), CmdAlterGroup(), CmdCreateGroup(), CmdDeleteGroup(), CmdRemoveAllVehiclesGroup(), CmdSetGroupFlag(), CmdSetGroupLivery(), VehicleGroupWindow::DrawWidget(), GroupStatistics::Get(), and UpdateCompanyGroupLiveries().
GroupID Group::parent = GroupID::Invalid() |
Parent group.
Definition at line 83 of file group.h.
Referenced by CmdAlterGroup(), CmdCreateGroup(), GetEngineLivery(), GetGroupNumEngines(), GetGroupNumVehicle(), GetGroupNumVehicleMinAge(), GetGroupProfitLastYearMinAge(), GRPSChunkHandler::Load(), VehicleGroupWindow::SelectGroup(), and UpdateCompanyGroupLiveries().
GroupStatistics Group::statistics {} |
NOSAVE: Statistics and caches on the vehicles in the group.
Definition at line 79 of file group.h.
Referenced by GroupStatistics::Get().
VehicleType Group::vehicle_type = VEH_INVALID |
Vehicle type of the group.
Definition at line 75 of file group.h.
Referenced by CcAddVehicleNewGroup(), CmdAddVehicleGroup(), CmdAlterGroup(), CmdCreateGroup(), CmdDeleteGroup(), CmdRemoveAllVehiclesGroup(), CmdSetGroupFlag(), and GroupStatistics::Get().