9724
|
1 |
/* $Id$ */
|
|
2 |
|
|
3 |
/** @file player_type.h Types related to players. */
|
|
4 |
|
|
5 |
#ifndef PLAYER_TYPE_H
|
|
6 |
#define PLAYER_TYPE_H
|
|
7 |
|
|
8 |
#include "core/enum_type.hpp"
|
|
9 |
|
|
10 |
/**
|
|
11 |
* Enum for all players/owners.
|
|
12 |
*/
|
|
13 |
enum Owner {
|
|
14 |
/* Player identifiers All players below MAX_PLAYERS are playable
|
|
15 |
* players, above, they are special, computer controlled players */
|
|
16 |
OWNER_BEGIN = 0x00, ///< First Owner
|
|
17 |
PLAYER_FIRST = 0x00, ///< First Player, same as owner
|
|
18 |
MAX_PLAYERS = 0x08, ///< Maximum numbe rof players
|
|
19 |
OWNER_TOWN = 0x0F, ///< A town owns the tile, or a town is expanding
|
|
20 |
OWNER_NONE = 0x10, ///< The tile has no ownership
|
|
21 |
OWNER_WATER = 0x11, ///< The tile/execution is done by "water"
|
|
22 |
OWNER_END, ///< Last + 1 owner
|
|
23 |
INVALID_OWNER = 0xFF, ///< An invalid owner
|
|
24 |
INVALID_PLAYER = 0xFF, ///< And a valid owner
|
|
25 |
|
|
26 |
/* 'Fake' Players used for networks */
|
|
27 |
PLAYER_INACTIVE_CLIENT = 253, ///< The client is joining
|
|
28 |
PLAYER_NEW_COMPANY = 254, ///< The client wants a new company
|
|
29 |
PLAYER_SPECTATOR = 255, ///< The client is spectating
|
|
30 |
};
|
|
31 |
DECLARE_POSTFIX_INCREMENT(Owner);
|
|
32 |
|
|
33 |
/** Define basic enum properties */
|
|
34 |
template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
|
|
35 |
typedef TinyEnumT<Owner> OwnerByte;
|
|
36 |
|
|
37 |
typedef Owner PlayerID;
|
|
38 |
typedef OwnerByte PlayerByte;
|
|
39 |
|
|
40 |
struct Player;
|
|
41 |
typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h
|
|
42 |
|
|
43 |
#endif /* PLAYER_TYPE_H */
|