OpenTTD Source 20241224-master-gf74b0cf984
company_type.h File Reference

Types related to companies. More...

#include "core/enum_type.hpp"

Go to the source code of this file.

Typedefs

typedef Owner CompanyID
 
typedef uint16_t CompanyMask
 
typedef uint32_t CompanyManagerFace
 Company manager face bits, info see in company_manager_face.h.
 

Enumerations

enum  Owner : uint8_t {
  OWNER_BEGIN = 0x00 , COMPANY_FIRST = 0x00 , MAX_COMPANIES = 0x0F , OWNER_TOWN = 0x0F ,
  OWNER_NONE = 0x10 , OWNER_WATER = 0x11 , OWNER_DEITY = 0x12 , OWNER_END ,
  INVALID_OWNER = 0xFF , INVALID_COMPANY = 0xFF , COMPANY_INACTIVE_CLIENT = 253 , COMPANY_NEW_COMPANY = 254 ,
  COMPANY_SPECTATOR = 255
}
 Enum for all companies/owners. More...
 
enum  CompanyRemoveReason : uint8_t {
  CRR_MANUAL , CRR_AUTOCLEAN , CRR_BANKRUPT , CRR_END ,
  CRR_NONE = CRR_MANUAL
}
 The reason why the company was removed. More...
 
enum  CompanyCtrlAction : uint8_t { CCA_NEW , CCA_NEW_AI , CCA_DELETE , CCA_END }
 The action to do with CMD_COMPANY_CTRL. More...
 
enum  CompanyAllowListCtrlAction : uint8_t { CALCA_ADD , CALCA_REMOVE , CALCA_END }
 The action to do with CMD_COMPANY_ALLOW_LIST_CTRL. More...
 

Variables

static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32
 The maximum length of a president name in characters including '\0'.
 
static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32
 The maximum length of a company name in characters including '\0'.
 
static const uint MAX_HISTORY_QUARTERS = 24
 The maximum number of quarters kept as performance's history.
 
static const uint MIN_COMPETITORS_INTERVAL = 0
 The minimum interval (in minutes) between competitors.
 
static const uint MAX_COMPETITORS_INTERVAL = 500
 The maximum interval (in minutes) between competitors.
 

Detailed Description

Types related to companies.

Definition in file company_type.h.

Typedef Documentation

◆ CompanyID

typedef Owner CompanyID

Definition at line 48 of file company_type.h.

◆ CompanyManagerFace

typedef uint32_t CompanyManagerFace

Company manager face bits, info see in company_manager_face.h.

Definition at line 53 of file company_type.h.

◆ CompanyMask

typedef uint16_t CompanyMask

Definition at line 50 of file company_type.h.

Enumeration Type Documentation

◆ CompanyAllowListCtrlAction

The action to do with CMD_COMPANY_ALLOW_LIST_CTRL.

Enumerator
CALCA_ADD 

Create a public key.

CALCA_REMOVE 

Remove a public key.

CALCA_END 

Sentinel for end.

Definition at line 76 of file company_type.h.

◆ CompanyCtrlAction

enum CompanyCtrlAction : uint8_t

The action to do with CMD_COMPANY_CTRL.

Enumerator
CCA_NEW 

Create a new company.

CCA_NEW_AI 

Create a new AI company.

CCA_DELETE 

Delete a company.

CCA_END 

Sentinel for end.

Definition at line 67 of file company_type.h.

◆ CompanyRemoveReason

enum CompanyRemoveReason : uint8_t

The reason why the company was removed.

Enumerator
CRR_MANUAL 

The company is manually removed.

CRR_AUTOCLEAN 

The company is removed due to autoclean.

CRR_BANKRUPT 

The company went belly-up.

CRR_END 

Sentinel for end.

CRR_NONE 

Dummy reason for actions that don't need one.

Definition at line 56 of file company_type.h.

◆ Owner

enum Owner : uint8_t

Enum for all companies/owners.

Enumerator
OWNER_BEGIN 

First owner.

COMPANY_FIRST 

First company, same as owner.

MAX_COMPANIES 

Maximum number of companies.

OWNER_TOWN 

A town owns the tile, or a town is expanding.

OWNER_NONE 

The tile has no ownership.

OWNER_WATER 

The tile/execution is done by "water".

OWNER_DEITY 

The object is owned by a superuser / goal script.

OWNER_END 

Last + 1 owner.

INVALID_OWNER 

An invalid owner.

INVALID_COMPANY 

An invalid company.

COMPANY_INACTIVE_CLIENT 

The client is joining.

COMPANY_NEW_COMPANY 

The client wants a new company.

COMPANY_SPECTATOR 

The client is spectating.

Definition at line 18 of file company_type.h.

Variable Documentation

◆ MAX_COMPETITORS_INTERVAL

const uint MAX_COMPETITORS_INTERVAL = 500
static

The maximum interval (in minutes) between competitors.

Definition at line 46 of file company_type.h.

Referenced by AIConfigWindow::OnClick(), and AIConfigWindow::OnInvalidateData().

◆ MAX_HISTORY_QUARTERS

const uint MAX_HISTORY_QUARTERS = 24
static

The maximum number of quarters kept as performance's history.

Definition at line 43 of file company_type.h.

Referenced by CompaniesGenStatistics().

◆ MAX_LENGTH_COMPANY_NAME_CHARS

const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32
static

The maximum length of a company name in characters including '\0'.

Definition at line 41 of file company_type.h.

Referenced by CmdRenameCompany(), GenerateCompanyName(), and CompanyWindow::OnClick().

◆ MAX_LENGTH_PRESIDENT_NAME_CHARS

const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32
static

The maximum length of a president name in characters including '\0'.

Definition at line 40 of file company_type.h.

Referenced by CmdRenamePresident(), GeneratePresidentName(), and CompanyWindow::OnClick().

◆ MIN_COMPETITORS_INTERVAL

const uint MIN_COMPETITORS_INTERVAL = 0
static

The minimum interval (in minutes) between competitors.

Definition at line 45 of file company_type.h.

Referenced by AIConfigWindow::OnClick(), and AIConfigWindow::OnInvalidateData().