diff options
author | rubidium <rubidium@openttd.org> | 2008-09-30 20:51:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-30 20:51:04 +0000 |
commit | b650a86e5859240e65d8654b5b08b211b2f33d7e (patch) | |
tree | 5cdc895449fdbe349dfb1703357a89cdea6cc5e0 /src/company_type.h | |
parent | 3b798599b63067c2e92aa49906ea66a07ae8de44 (diff) | |
download | openttd-b650a86e5859240e65d8654b5b08b211b2f33d7e.tar.xz |
(svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
Diffstat (limited to 'src/company_type.h')
-rw-r--r-- | src/company_type.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/company_type.h b/src/company_type.h new file mode 100644 index 000000000..13ea10c48 --- /dev/null +++ b/src/company_type.h @@ -0,0 +1,52 @@ +/* $Id$ */ + +/** @file company_type.h Types related to companies. */ + +#ifndef COMPANY_TYPE_H +#define COMPANY_TYPE_H + +#include "core/enum_type.hpp" + +/** + * Enum for all companies/owners. + */ +enum Owner { + /* All companies below MAX_COMPANIES are playable + * companies, above, they are special, computer controlled 'companies' */ + OWNER_BEGIN = 0x00, ///< First owner + COMPANY_FIRST = 0x00, ///< First company, same as owner + MAX_COMPANIES = 0x08, ///< Maximum number of companies + OWNER_TOWN = 0x0F, ///< A town owns the tile, or a town is expanding + OWNER_NONE = 0x10, ///< The tile has no ownership + OWNER_WATER = 0x11, ///< The tile/execution is done by "water" + OWNER_END, ///< Last + 1 owner + INVALID_OWNER = 0xFF, ///< An invalid owner + INVALID_COMPANY = 0xFF, ///< An invalid company + + /* 'Fake' companies used for networks */ + COMPANY_INACTIVE_CLIENT = 253, ///< The client is joining + COMPANY_NEW_COMPANY = 254, ///< The client wants a new company + COMPANY_SPECTATOR = 255, ///< The client is spectating +}; +DECLARE_POSTFIX_INCREMENT(Owner); + +enum { + MAX_LENGTH_PRESIDENT_NAME_BYTES = 31, ///< The maximum length of a president name in bytes including '\0' + MAX_LENGTH_PRESIDENT_NAME_PIXELS = 94, ///< The maximum length of a president name in pixels + MAX_LENGTH_COMPANY_NAME_BYTES = 31, ///< The maximum length of a company name in bytes including '\0' + MAX_LENGTH_COMPANY_NAME_PIXELS = 150, ///< The maximum length of a company name in pixels +}; + +/** Define basic enum properties */ +template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {}; +typedef TinyEnumT<Owner> OwnerByte; + +typedef Owner CompanyID; +typedef OwnerByte CompanyByte; + +typedef uint8 CompanyMask; + +struct Company; +typedef uint32 CompanyManagerFace; ///< Company manager face bits, info see in company_manager_face.h + +#endif /* COMPANY_TYPE_H */ |