OpenTTD Source 20241224-master-gf74b0cf984
Group Struct Reference

Group data. More...

#include <group.h>

Inheritance diagram for Group:
Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >

Public Member Functions

 Group (CompanyID owner=INVALID_COMPANY)
 
- Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >
void * operator new (size_t size)
 Allocates space for new Titem.
 
void * operator new (size_t size, size_t 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)
 Marks Titem as free.
 

Data Fields

std::string name
 Group Name.
 
Owner owner
 Group Owner.
 
VehicleType vehicle_type
 Vehicle type of the group.
 
uint8_t 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
 NOSAVE: Is this group folded in the group view?
 
GroupID parent
 Parent group.
 
uint16_t number
 Per-company group number.
 
- Data Fields inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >
Tindex index
 Index of this pool item.
 

Additional Inherited Members

- Public Types inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >
typedef struct Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero > Pool
 Type of the pool this item is going to be part of.
 
- Static Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_group_pool >
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 (size_t index)
 Tests whether given index can be used to get valid (non-nullptr) Titem.
 
static Titem * Get (size_t index)
 Returns Titem with given index.
 
static Titem * GetIfValid (size_t 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.
 

Detailed Description

Group data.

Definition at line 72 of file group.h.

Constructor & Destructor Documentation

◆ Group()

Group::Group ( CompanyID  owner = INVALID_COMPANY)

Definition at line 322 of file group_cmd.cpp.

Field Documentation

◆ flags

◆ folded

bool Group::folded

NOSAVE: Is this group folded in the group view?

Definition at line 81 of file group.h.

Referenced by VehicleGroupWindow::DrawWidget().

◆ livery

◆ name

std::string Group::name

Group Name.

Definition at line 73 of file group.h.

Referenced by CmdAlterGroup(), and FormatString().

◆ number

uint16_t Group::number

Per-company group number.

Definition at line 84 of file group.h.

Referenced by BuildGuiGroupList(), CmdCreateGroup(), CmdDeleteGroup(), and FormatString().

◆ owner

◆ parent

◆ statistics

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().

◆ vehicle_type


The documentation for this struct was generated from the following files: