1 /*
2 * Biloba
3 * Copyright (C) 2004-2008 Guillaume Demougeot, Colin Leroy
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #ifndef __PLAYER_H__
21 #define __PLAYER_H__
22
23 #include "pawn.h"
24 #include "tile.h"
25 #include "llist.h"
26
27 typedef enum {
28 INPUT_LOCAL,
29 INPUT_NETWORK,
30 INPUT_AI,
31 INPUT_REPLAY,
32 NUM_INPUT_SYSTEMS
33 } InputSystemMethod;
34
input_system_names(InputSystemMethod i)35 static inline char *input_system_names(InputSystemMethod i) {
36 char *name[3] = {
37 "LOCAL",
38 "NETWORK",
39 "AI" };
40 if (i < 0 || i >= NUM_INPUT_SYSTEMS)
41 return "WRONG TYPE";
42
43 return name[i];
44 };
45
46
47
48 typedef struct _Player {
49 PawnColor color;
50 InputSystemMethod method;
51 const char *name;
52 } Player;
53
54 Player *player_get(PawnColor color, int reinit, InputSystemMethod method);
55 LList *player_can_eat_soon(Player *player, int now_too, LList *allowed_pawns);
56 LList *player_can_be_eaten(Player *player, int now_too, LList *allowed_pawns);
57
58 Tile *player_select_tile(Player *player, LList *allowed);
59
60 void player_set_name(Player *player, const char *name);
61
62 #endif
63