# company_type.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef COMPANY_TYPE_H
    00013 #define COMPANY_TYPE_H
    00014
    00015 #include "core/enum_type.hpp"
    00016
    00020 enum Owner {
    00021   /* All companies below MAX_COMPANIES are playable
    00022    * companies, above, they are special, computer controlled 'companies' */
    00023   OWNER_BEGIN     = 0x00,
    00024   COMPANY_FIRST   = 0x00,
    00025   MAX_COMPANIES   = 0x0F,
    00026   OWNER_TOWN      = 0x0F,
    00027   OWNER_NONE      = 0x10,
    00028   OWNER_WATER     = 0x11,
    00029   OWNER_DEITY     = 0x12,
    00030   OWNER_END,
    00031   INVALID_OWNER   = 0xFF,
    00032   INVALID_COMPANY = 0xFF,
    00033
    00034   /* 'Fake' companies used for networks */
    00035   COMPANY_INACTIVE_CLIENT = 253,
    00036   COMPANY_NEW_COMPANY     = 254,
    00037   COMPANY_SPECTATOR       = 255,
    00038 };
    00039 DECLARE_POSTFIX_INCREMENT(Owner)
    00040
    00041 static const uint MAX_LENGTH_PRESIDENT_NAME_CHARS = 32;
    00042 static const uint MAX_LENGTH_COMPANY_NAME_CHARS   = 32;
    00043
    00044 static const uint MAX_HISTORY_QUARTERS            = 24;
    00045
    00047 template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
    00048 typedef TinyEnumT<Owner> OwnerByte;
    00049
    00050 typedef Owner CompanyID;
    00051 typedef OwnerByte CompanyByte;
    00052
    00053 typedef uint16 CompanyMask;
    00054
    00055 struct Company;
    00056 typedef uint32 CompanyManagerFace;
    00057
    00059 enum CompanyRemoveReason {
    00060   CRR_MANUAL,
    00061   CRR_AUTOCLEAN,
    00062   CRR_BANKRUPT,
    00063
    00064   CRR_END,
    00065 };
    00066
    00067 #endif /* COMPANY_TYPE_H */