rubidium@8254: /* $Id$ */ rubidium@8254: rubidium@8254: /** @file player_type.h Types related to players. */ rubidium@8254: rubidium@8254: #ifndef PLAYER_TYPE_H rubidium@8254: #define PLAYER_TYPE_H rubidium@8254: rubidium@8263: #include "core/enum_type.hpp" rubidium@8263: rubidium@8254: /** rubidium@8254: * Enum for all players/owners. rubidium@8254: */ rubidium@8254: enum Owner { rubidium@8254: /* Player identifiers All players below MAX_PLAYERS are playable rubidium@8254: * players, above, they are special, computer controlled players */ rubidium@8254: OWNER_BEGIN = 0x00, ///< First Owner rubidium@8254: PLAYER_FIRST = 0x00, ///< First Player, same as owner rubidium@8254: MAX_PLAYERS = 0x08, ///< Maximum numbe rof players rubidium@8254: OWNER_TOWN = 0x0F, ///< A town owns the tile, or a town is expanding rubidium@8254: OWNER_NONE = 0x10, ///< The tile has no ownership rubidium@8254: OWNER_WATER = 0x11, ///< The tile/execution is done by "water" rubidium@8254: OWNER_END, ///< Last + 1 owner rubidium@8254: INVALID_OWNER = 0xFF, ///< An invalid owner rubidium@8254: INVALID_PLAYER = 0xFF, ///< And a valid owner rubidium@8254: rubidium@8254: /* 'Fake' Players used for networks */ rubidium@8254: PLAYER_INACTIVE_CLIENT = 253, ///< The client is joining rubidium@8254: PLAYER_NEW_COMPANY = 254, ///< The client wants a new company rubidium@8254: PLAYER_SPECTATOR = 255, ///< The client is spectating rubidium@8254: }; rubidium@8254: DECLARE_POSTFIX_INCREMENT(Owner); rubidium@8254: rubidium@9645: enum { rubidium@9645: MAX_LENGTH_PRESIDENT_NAME = 31, ///< The maximum length for a president's name rubidium@9645: MAX_LENGTH_COMPANY_NAME = 31, ///< The maximum length for a company's name rubidium@9645: }; rubidium@9645: rubidium@8254: /** Define basic enum properties */ rubidium@8254: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@8254: typedef TinyEnumT OwnerByte; rubidium@8254: rubidium@8254: typedef Owner PlayerID; rubidium@8254: typedef OwnerByte PlayerByte; rubidium@8254: rubidium@9709: typedef uint8 PlayerMask; rubidium@9709: rubidium@8254: struct Player; rubidium@8254: typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h rubidium@8254: rubidium@8254: #endif /* PLAYER_TYPE_H */