2008-01-12 14:10:35 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
/** @file company_type.h Types related to companies. */
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
#ifndef COMPANY_TYPE_H
|
|
|
|
#define COMPANY_TYPE_H
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-01-13 00:28:01 +00:00
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
2008-01-12 14:10:35 +00:00
|
|
|
/**
|
2008-09-30 20:39:50 +00:00
|
|
|
* Enum for all companies/owners.
|
2008-01-12 14:10:35 +00:00
|
|
|
*/
|
|
|
|
enum Owner {
|
2008-09-30 20:39:50 +00:00
|
|
|
/* 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
|
2008-12-24 09:53:15 +00:00
|
|
|
MAX_COMPANIES = 0x0F, ///< Maximum number of companies
|
2008-01-12 14:10:35 +00:00
|
|
|
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
|
2008-09-30 20:39:50 +00:00
|
|
|
INVALID_COMPANY = 0xFF, ///< An invalid company
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
/* '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
|
2008-01-12 14:10:35 +00:00
|
|
|
};
|
|
|
|
DECLARE_POSTFIX_INCREMENT(Owner);
|
|
|
|
|
2008-07-17 11:19:20 +00:00
|
|
|
enum {
|
2008-08-13 06:05:01 +00:00
|
|
|
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
|
2008-07-17 11:19:20 +00:00
|
|
|
};
|
|
|
|
|
2008-01-12 14:10:35 +00:00
|
|
|
/** Define basic enum properties */
|
|
|
|
template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
|
|
|
|
typedef TinyEnumT<Owner> OwnerByte;
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
typedef Owner CompanyID;
|
|
|
|
typedef OwnerByte CompanyByte;
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-12-24 09:53:15 +00:00
|
|
|
typedef uint16 CompanyMask;
|
2008-07-25 10:00:03 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
struct Company;
|
|
|
|
typedef uint32 CompanyManagerFace; ///< Company manager face bits, info see in company_manager_face.h
|
2008-01-12 14:10:35 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
#endif /* COMPANY_TYPE_H */
|