OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

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,
30 OWNER_END,
31 INVALID_OWNER = 0xFF,
32 INVALID_COMPANY = 0xFF,
33
34 /* 'Fake' companies used for networks */
35 COMPANY_INACTIVE_CLIENT = 253,
36 COMPANY_NEW_COMPANY = 254,
37 COMPANY_SPECTATOR = 255,
38 };
39 DECLARE_POSTFIX_INCREMENT(Owner)
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
47 template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
48 typedef TinyEnumT<Owner> OwnerByte;
49
50 typedef Owner CompanyID;
51 typedef OwnerByte CompanyByte;
52
53 typedef uint16 CompanyMask;
54
55 struct Company;
56 typedef uint32 CompanyManagerFace;
57
59 enum CompanyRemoveReason {
60 CRR_MANUAL,
61 CRR_AUTOCLEAN,
62 CRR_BANKRUPT,
63
64 CRR_END,
65 };
66
67 #endif /* COMPANY_TYPE_H */