OpenTTD
company_type.h
Go to the documentation of this file.
1 /* $Id: company_type.h 23602 2011-12-19 20:50:36Z truebrain $ */
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 {
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 
49 
50 typedef Owner CompanyID;
51 typedef OwnerByte CompanyByte;
52 
53 typedef uint16 CompanyMask;
54 
55 struct Company;
56 typedef uint32 CompanyManagerFace;
57 
63 
65 };
66 
67 #endif /* COMPANY_TYPE_H */
Last + 1 owner.
Definition: company_type.h:30
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:66
The client is joining.
Definition: company_type.h:35
The company is manually removed.
Definition: company_type.h:60
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
The client is spectating.
Definition: company_type.h:37
The client wants a new company.
Definition: company_type.h:36
Type (helpers) for enums.
The object is owned by a superuser / goal script.
Definition: company_type.h:29
The company is removed due to autoclean.
Definition: company_type.h:61
First owner.
Definition: company_type.h:23
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition: company_type.h:55
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:52
First company, same as owner.
Definition: company_type.h:24
The tile has no ownership.
Definition: company_type.h:27
Sentinel for end.
Definition: company_type.h:64
Maximum number of companies.
Definition: company_type.h:25
static const uint MAX_HISTORY_QUARTERS
The maximum number of quarters kept as performance&#39;s history.
Definition: company_type.h:44
A town owns the tile, or a town is expanding.
Definition: company_type.h:26
The company went belly-up.
Definition: company_type.h:62
CompanyRemoveReason
The reason why the company was removed.
Definition: company_type.h:59
Owner
Enum for all companies/owners.
Definition: company_type.h:20
#define DECLARE_POSTFIX_INCREMENT(type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:16
An invalid company.
Definition: company_type.h:32
The tile/execution is done by "water".
Definition: company_type.h:28
An invalid owner.
Definition: company_type.h:31