Files @ r10045:f6d1b92735b7
Branch filter:

Location: cpp/openttd-patchpack/source/src/player_type.h

translators
(svn r14205) -Update: WebTranslator2 update to 2008-08-31 19:47:56
bulgarian - 12 fixed by thetitan (12)
catalan - 49 fixed by arnaullv (49)
czech - 4 fixed, 15 changed by Hadez (19)
dutch - 2 fixed, 5 changed by habell (7)
french - 2 fixed, 1 changed by belugas (1), glx (2)
galician - 75 fixed, 54 changed by Condex (129)
german - 10 fixed, 1 changed by dih (11)
italian - 5 fixed, 5 changed by lorenzodv (10)
korean - 14 fixed by leejaeuk5 (14)
slovenian - 6 fixed by Necrolyte (6)
turkish - 18 fixed by jnmbk (18)
ukrainian - 2 fixed by mad (2)
/* $Id$ */

/** @file player_type.h Types related to players. */

#ifndef PLAYER_TYPE_H
#define PLAYER_TYPE_H

#include "core/enum_type.hpp"

/**
 * Enum for all players/owners.
 */
enum Owner {
	/* Player identifiers All players below MAX_PLAYERS are playable
	 * players, above, they are special, computer controlled players */
	OWNER_BEGIN     = 0x00, ///< First Owner
	PLAYER_FIRST    = 0x00, ///< First Player, same as owner
	MAX_PLAYERS     = 0x08, ///< Maximum numbe rof players
	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_PLAYER  = 0xFF, ///< And a valid owner

	/* 'Fake' Players used for networks */
	PLAYER_INACTIVE_CLIENT = 253, ///< The client is joining
	PLAYER_NEW_COMPANY     = 254, ///< The client wants a new company
	PLAYER_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 PlayerID;
typedef OwnerByte PlayerByte;

typedef uint8 PlayerMask;

struct Player;
typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h

#endif /* PLAYER_TYPE_H */