Public Member Functions | |
Company (uint16 name_1=0, bool is_ai=false) | |
Constructor. | |
~Company () | |
Destructor. | |
Static Public Member Functions | |
static FORCEINLINE bool | IsValidAiID (size_t index) |
Is this company a valid company, controlled by the computer (a NoAI program)? | |
static FORCEINLINE bool | IsValidHumanID (size_t index) |
Is this company a valid company, not controlled by a NoAI program? | |
static FORCEINLINE bool | IsHumanID (size_t index) |
Is this company a company not controlled by a NoAI program? | |
static void | PostDestructor (size_t index) |
Invalidating some stuff after removing item from the pool. | |
Data Fields | |
Livery | livery [LS_END] |
RoadTypes | avail_roadtypes |
Road types available to this company. | |
class AIInstance * | ai_instance |
class AIInfo * | ai_info |
EngineRenewList | engine_renew_list |
Engine renewals of this company. | |
CompanySettings | settings |
settings specific for each company | |
uint16 * | num_engines |
caches the number of engines of each type the company owns (no need to save this) |
Definition at line 92 of file company_base.h.
Company::Company | ( | uint16 | name_1 = 0 , |
|
bool | is_ai = false | |||
) |
Constructor.
name_1 | Name of the company. | |
is_ai | A computer program is running for this company. |
Definition at line 55 of file company_cmd.cpp.
References COMPANY_SPECTATOR, INVALID_COMPANY, INVALID_TILE, and InvalidateWindowData().
Company::~Company | ( | ) |
Destructor.
Definition at line 65 of file company_cmd.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::CleaningPool(), DeleteCompanyWindows(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::index, and num_engines.
static FORCEINLINE bool Company::IsHumanID | ( | size_t | index | ) | [inline, static] |
Is this company a company not controlled by a NoAI program?
index | Index in the pool. |
true
if it is a human controlled company, else false
. Definition at line 136 of file company_base.h.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::Get().
Referenced by DisasterTick_Big_Ufo().
static FORCEINLINE bool Company::IsValidAiID | ( | size_t | index | ) | [inline, static] |
Is this company a valid company, controlled by the computer (a NoAI program)?
index | Index in the pool. |
true
if it is a valid, computer controlled company, else false
. Definition at line 111 of file company_base.h.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), and CompanyProperties::is_ai.
Referenced by AI::GameLoop(), AIInstance::GetStorage(), AI::NewEvent(), AIDebugWindow::OnPaint(), and AIDebugWindow::SetStringParameters().
static FORCEINLINE bool Company::IsValidHumanID | ( | size_t | index | ) | [inline, static] |
Is this company a valid company, not controlled by a NoAI program?
index | Index in the pool. |
true
if it is a valid, human controlled company, else false
. Definition at line 123 of file company_base.h.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), and CompanyProperties::is_ai.
Referenced by FormatString().
void Company::PostDestructor | ( | size_t | index | ) | [static] |
Invalidating some stuff after removing item from the pool.
index | index of deleted item |
Reimplemented from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem<&_company_pool >.
Definition at line 78 of file company_cmd.cpp.
References InvalidateWindowData().