author | rubidium |
Wed, 13 Aug 2008 06:05:01 +0000 | |
changeset 9913 | d9ce89020cc0 |
parent 9709 | fc8c47cbfcf2 |
child 10207 | c291a21b304e |
permissions | -rw-r--r-- |
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
2 |
|
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
3 |
/** @file player_type.h Types related to players. */ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
4 |
|
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
5 |
#ifndef PLAYER_TYPE_H |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
6 |
#define PLAYER_TYPE_H |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
7 |
|
8263
2b3e64c5e680
(svn r11827) -Codechange: do not include enum_type.hpp unnecessary.
rubidium
parents:
8254
diff
changeset
|
8 |
#include "core/enum_type.hpp" |
2b3e64c5e680
(svn r11827) -Codechange: do not include enum_type.hpp unnecessary.
rubidium
parents:
8254
diff
changeset
|
9 |
|
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
10 |
/** |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
11 |
* Enum for all players/owners. |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
12 |
*/ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
13 |
enum Owner { |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
14 |
/* Player identifiers All players below MAX_PLAYERS are playable |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
15 |
* players, above, they are special, computer controlled players */ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
16 |
OWNER_BEGIN = 0x00, ///< First Owner |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
17 |
PLAYER_FIRST = 0x00, ///< First Player, same as owner |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
18 |
MAX_PLAYERS = 0x08, ///< Maximum numbe rof players |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
19 |
OWNER_TOWN = 0x0F, ///< A town owns the tile, or a town is expanding |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
20 |
OWNER_NONE = 0x10, ///< The tile has no ownership |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
21 |
OWNER_WATER = 0x11, ///< The tile/execution is done by "water" |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
22 |
OWNER_END, ///< Last + 1 owner |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
23 |
INVALID_OWNER = 0xFF, ///< An invalid owner |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
24 |
INVALID_PLAYER = 0xFF, ///< And a valid owner |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
25 |
|
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
26 |
/* 'Fake' Players used for networks */ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
27 |
PLAYER_INACTIVE_CLIENT = 253, ///< The client is joining |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
28 |
PLAYER_NEW_COMPANY = 254, ///< The client wants a new company |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
29 |
PLAYER_SPECTATOR = 255, ///< The client is spectating |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
30 |
}; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
31 |
DECLARE_POSTFIX_INCREMENT(Owner); |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
32 |
|
9645
aee985cc98b5
(svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents:
8263
diff
changeset
|
33 |
enum { |
9913
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9709
diff
changeset
|
34 |
MAX_LENGTH_PRESIDENT_NAME_BYTES = 31, ///< The maximum length of a president name in bytes including '\0' |
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9709
diff
changeset
|
35 |
MAX_LENGTH_PRESIDENT_NAME_PIXELS = 94, ///< The maximum length of a president name in pixels |
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9709
diff
changeset
|
36 |
MAX_LENGTH_COMPANY_NAME_BYTES = 31, ///< The maximum length of a company name in bytes including '\0' |
d9ce89020cc0
(svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium
parents:
9709
diff
changeset
|
37 |
MAX_LENGTH_COMPANY_NAME_PIXELS = 150, ///< The maximum length of a company name in pixels |
9645
aee985cc98b5
(svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents:
8263
diff
changeset
|
38 |
}; |
aee985cc98b5
(svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents:
8263
diff
changeset
|
39 |
|
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
40 |
/** Define basic enum properties */ |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
41 |
template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {}; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
42 |
typedef TinyEnumT<Owner> OwnerByte; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
43 |
|
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
44 |
typedef Owner PlayerID; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
45 |
typedef OwnerByte PlayerByte; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
46 |
|
9709
fc8c47cbfcf2
(svn r13821) -Codechange: replace some uint8/bytes with more specificly named typedefs and replace a few magic numbers.
rubidium
parents:
9645
diff
changeset
|
47 |
typedef uint8 PlayerMask; |
fc8c47cbfcf2
(svn r13821) -Codechange: replace some uint8/bytes with more specificly named typedefs and replace a few magic numbers.
rubidium
parents:
9645
diff
changeset
|
48 |
|
8254
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
49 |
struct Player; |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
50 |
typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h |
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
51 |
|
1496654ca5e7
(svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff
changeset
|
52 |
#endif /* PLAYER_TYPE_H */ |