OpenTTD
company_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef COMPANY_TYPE_H
11 #define COMPANY_TYPE_H
12 
13 #include "core/enum_type.hpp"
14 
18 enum Owner : byte {
19  /* All companies below MAX_COMPANIES are playable
20  * companies, above, they are special, computer controlled 'companies' */
21  OWNER_BEGIN = 0x00,
22  COMPANY_FIRST = 0x00,
23  MAX_COMPANIES = 0x0F,
24  OWNER_TOWN = 0x0F,
25  OWNER_NONE = 0x10,
26  OWNER_WATER = 0x11,
27  OWNER_DEITY = 0x12,
29  INVALID_OWNER = 0xFF,
30  INVALID_COMPANY = 0xFF,
31 
32  /* 'Fake' companies used for networks */
36 };
38 
39 static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32;
40 static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32;
41 
42 static const uint MAX_HISTORY_QUARTERS = 24;
43 
46 
47 typedef Owner CompanyID;
48 
49 typedef uint16 CompanyMask;
50 
51 struct Company;
52 typedef uint32 CompanyManagerFace;
53 
59 
61 };
62 
68 
70 };
71 
72 #endif /* COMPANY_TYPE_H */
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:62
Owner
Enum for all companies/owners.
Definition: company_type.h:18
An invalid owner.
Definition: company_type.h:29
A town owns the tile, or a town is expanding.
Definition: company_type.h:24
The company is manually removed.
Definition: company_type.h:56
The client wants a new company.
Definition: company_type.h:34
static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS
The maximum length of a president name in characters including &#39;\0&#39;.
Definition: company_type.h:39
Type (helpers) for enums.
The company is removed due to autoclean.
Definition: company_type.h:57
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition: company_type.h:51
The tile has no ownership.
Definition: company_type.h:25
The client is spectating.
Definition: company_type.h:35
Create a new AI company.
Definition: company_type.h:66
static const uint MAX_LENGTH_COMPANY_NAME_CHARS
The maximum length of a company name in characters including &#39;\0&#39;.
Definition: company_type.h:40
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
Sentinel for end.
Definition: company_type.h:69
Sentinel for end.
Definition: company_type.h:60
Last + 1 owner.
Definition: company_type.h:28
Delete a company.
Definition: company_type.h:67
The client is joining.
Definition: company_type.h:33
The tile/execution is done by "water".
Definition: company_type.h:26
An invalid company.
Definition: company_type.h:30
static const uint MAX_HISTORY_QUARTERS
The maximum number of quarters kept as performance&#39;s history.
Definition: company_type.h:42
CompanyCtrlAction
The action to do with CMD_COMPANY_CTRL.
Definition: company_type.h:64
The company went belly-up.
Definition: company_type.h:58
First company, same as owner.
Definition: company_type.h:22
First owner.
Definition: company_type.h:21
Maximum number of companies.
Definition: company_type.h:23
CompanyRemoveReason
The reason why the company was removed.
Definition: company_type.h:55
Create a new company.
Definition: company_type.h:65
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
The object is owned by a superuser / goal script.
Definition: company_type.h:27