File: player.h

package info (click to toggle)
xconq 7.2.2-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,296 kB
  • ctags: 9,199
  • sloc: ansic: 107,849; sh: 2,108; perl: 2,057; makefile: 1,177; sed: 161; csh: 50; awk: 49; lisp: 39
file content (43 lines) | stat: -rw-r--r-- 1,649 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Definitions for players in Xconq.
   Copyright (C) 1992, 1993, 1994, 1996 Stanley T. Shebs.

Xconq is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.  See the file COPYING.  */

typedef struct a_player {
    short id;			/* unique id for the player */
    char *name;			/* proper name of the player */
    char *configname;		/* name of a particular configuration */
    char *displayname;		/* name of the desired display */
    char *aitypename;		/* name of an AI type */
    short advantage;		/* player's desired initial advantage */
    char *remotewanted;		/* name of remote desired for player */
    char *password;		/* encrypted password of the player */
    int rid;			/* identifier of the player's program */
    struct a_side *side;	/* the side being played */
    struct a_player *next;	/* pointer to the next player */
} Player;

/* This is the mapping between players and sides. */

typedef struct {
    struct a_side *side;	/* the side */
    struct a_player *player;	/* the player assigned to the side */
    int locked;			/* true if the assignment can't be changed */
} Assign;

/* Iteration over all players. */

#define for_all_players(v) for (v = playerlist; v != NULL; v = v->next)

extern Player *playerlist;
extern Player *last_player;

extern Assign *assignments;

extern Player *add_player PARAMS ((void));
extern Player *find_player PARAMS ((int n));
extern void canonicalize_player PARAMS ((Player *player));
extern char *player_desig PARAMS ((Player *player));