src/player_type.h
author peter1138
Sun, 03 Aug 2008 17:35:08 +0000
changeset 9834 7474149531c1
parent 9709 fc8c47cbfcf2
child 9913 d9ce89020cc0
permissions -rw-r--r--
(svn r13977) -Codechange: Let ResizeWindowForWidget() handle hidden (zero height or zero width) widgets.
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 {
aee985cc98b5 (svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents: 8263
diff changeset
    34
	MAX_LENGTH_PRESIDENT_NAME = 31, ///< The maximum length for a president's name
aee985cc98b5 (svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents: 8263
diff changeset
    35
	MAX_LENGTH_COMPANY_NAME   = 31, ///< The maximum length for a company's name
aee985cc98b5 (svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents: 8263
diff changeset
    36
};
aee985cc98b5 (svn r13712) -Fix: enforce the length restrictions of company and president name in the commands too.
rubidium
parents: 8263
diff changeset
    37
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    38
/** Define basic enum properties */
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    39
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
    40
typedef TinyEnumT<Owner> OwnerByte;
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    41
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    42
typedef Owner PlayerID;
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    43
typedef OwnerByte PlayerByte;
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    44
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
    45
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
    46
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    47
struct Player;
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    48
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
    49
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    50
#endif /* PLAYER_TYPE_H */