OpenTTD
company_type.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef COMPANY_TYPE_H
13 #define COMPANY_TYPE_H
14 
15 #include "core/enum_type.hpp"
16 
20 enum Owner : byte {
21  /* All companies below MAX_COMPANIES are playable
22  * companies, above, they are special, computer controlled 'companies' */
23  OWNER_BEGIN = 0x00,
24  COMPANY_FIRST = 0x00,
25  MAX_COMPANIES = 0x0F,
26  OWNER_TOWN = 0x0F,
27  OWNER_NONE = 0x10,
28  OWNER_WATER = 0x11,
29  OWNER_DEITY = 0x12,
31  INVALID_OWNER = 0xFF,
32  INVALID_COMPANY = 0xFF,
33 
34  /* 'Fake' companies used for networks */
38 };
40 
41 static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32;
42 static const uint MAX_LENGTH_COMPANY_NAME_CHARS = 32;
43 
44 static const uint MAX_HISTORY_QUARTERS = 24;
45 
48 
49 typedef Owner CompanyID;
50 
51 typedef uint16 CompanyMask;
52 
53 struct Company;
54 typedef uint32 CompanyManagerFace;
55 
61 
63 };
64 
70 
72 };
73 
74 #endif /* COMPANY_TYPE_H */
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:64
Owner
Enum for all companies/owners.
Definition: company_type.h:20
An invalid owner.
Definition: company_type.h:31
A town owns the tile, or a town is expanding.
Definition: company_type.h:26
The company is manually removed.
Definition: company_type.h:58
The client wants a new company.
Definition: company_type.h:36
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:41
Type (helpers) for enums.
The company is removed due to autoclean.
Definition: company_type.h:59
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition: company_type.h:53
The tile has no ownership.
Definition: company_type.h:27
The client is spectating.
Definition: company_type.h:37
Create a new AI company.
Definition: company_type.h:68
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:42
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:50
Sentinel for end.
Definition: company_type.h:71
Sentinel for end.
Definition: company_type.h:62
Last + 1 owner.
Definition: company_type.h:30
Delete a company.
Definition: company_type.h:69
The client is joining.
Definition: company_type.h:35
The tile/execution is done by "water".
Definition: company_type.h:28
An invalid company.
Definition: company_type.h:32
static const uint MAX_HISTORY_QUARTERS
The maximum number of quarters kept as performance&#39;s history.
Definition: company_type.h:44
CompanyCtrlAction
The action to do with CMD_COMPANY_CTRL.
Definition: company_type.h:66
The company went belly-up.
Definition: company_type.h:60
First company, same as owner.
Definition: company_type.h:24
First owner.
Definition: company_type.h:23
Maximum number of companies.
Definition: company_type.h:25
CompanyRemoveReason
The reason why the company was removed.
Definition: company_type.h:57
Create a new company.
Definition: company_type.h:67
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:16
The object is owned by a superuser / goal script.
Definition: company_type.h:29