Fix mamer crash on listmanagers command
[capablanca.git] / lasker-2.2.3 / bots / mamer / types.h
1 //--------------------------------------------------------------------------
2 // types.h - Header file for types
3 //
4 // Matthew E. Moses & Michael A. Long
5 //
6 // $Revision: 1.11 $
7 // $Date: 1998/09/10 19:58:20 $
8 //
9 // $Author: mlong $
10 // $Locker:  $
11 //
12 // $Log: types.h,v $
13 // Revision 1.11  1998/09/10 19:58:20  mlong
14 // *** empty log message ***
15 //
16 // Revision 1.10  1998/06/18 18:42:09  mlong
17 // prepairing for yet another move.
18 //
19 // Revision 1.9  1998/06/04 19:56:02  mlong
20 // *** empty log message ***
21 //
22 // Revision 1.8  1998/04/18 19:00:07  mlong
23 // fixed delete bug and added delete tourney fuction
24 //
25 // Revision 1.7  1998/02/12 18:44:34  mlong
26 // *** empty log message ***
27 //
28 // Revision 1.6  1997/11/06 20:51:29  chess
29 // *** empty log message ***
30 //
31 // Revision 1.5  1997/10/08 21:03:08  chess
32 // no log message
33 //
34 // Revision 1.4  1997/05/15 18:30:27  chess
35 // *** empty log message ***
36 //
37 // Revision 1.3  1997/04/13 03:24:42  chess
38 // added several enumerated types for params stuff and for TellUser outputs
39 //
40 // Revision 1.2  1997/04/07 22:22:26  chess
41 // added enum ranks
42 // and added enum reasons for why we are calling a centralized telluser function
43 //
44 // Revision 1.1  1996/10/01 20:17:34  moses
45 // Initial revision
46 //
47 //
48 //--------------------------------------------------------------------------
49
50 #ifndef _TYPES_
51 #define _TYPES_
52
53 class Mamer;
54 class User;
55 class Tourney;
56 class CommandEntry;
57 class Player;
58 class Storage;
59
60 typedef enum {
61   USER=0,
62   DIRECTOR=10,
63   MANAGER=25,
64   VICE=50,
65   PRESIDENT=100
66 } ranks;
67
68 typedef enum {
69   BadCommand,
70   MultiCommand,
71   CanNotChange,
72   ChangedManagerLevel,
73   ChangedCommandLevel,
74   ChangedInfo,
75   ChangedAbuse,
76   GenericTell,
77   JoinedTourney,
78   WillKeepTourney,
79   NoPermissions,
80   NotEnoughPlayers,
81   NotFound,
82   NotKeepTourney,
83   NoPlayers,
84   PlayerRemoved,
85   TourneyDeleted,
86   TourneyNotFound,
87   TourneyNotNew,
88   TourneyNotOpen,
89   TourneyNotClosed,
90   TourneyDone,
91   TourneyClosed,
92   GameResultNotFound,
93   GameResultSet
94 } reasons;
95
96 #define COM_OK 0
97 #define COM_FAILED 1
98 #define COM_AMBIGUOUS 2
99 #define COM_BADPARAMETERS 3
100 #define COM_BADCOMMAND 4
101
102 typedef enum {
103   ONLINE,
104   GONE,
105 } locations;
106
107 typedef enum {
108   TYPE_NONE=-1,
109   TYPE_UNTIMED, 
110   TYPE_BLITZ, 
111   TYPE_STAND, 
112   TYPE_NONSTANDARD,
113   TYPE_WILD, 
114   TYPE_LIGHT, 
115   TYPE_BUGHOUSE, 
116   TYPE_FR,
117   TYPE_SUICIDE
118 } gametype;
119
120 typedef enum {
121   NEW,
122   OPEN,
123   CLOSED,
124   DONE
125 } status;
126
127
128 typedef enum {
129   TYPE_NULL,
130   TYPE_WORD,
131   TYPE_STRING,
132   TYPE_INT
133 } types;
134
135 typedef struct u_parameter {
136   types type;
137   union {
138     char *word;
139     char *string;
140     int integer;
141   } val;
142 } parameter;
143
144 struct string_list {
145   char *string;
146   int number;
147 };
148
149 typedef struct string_list strings;
150
151 #define MAXNUMPARAMS     10
152 typedef parameter param_list[MAXNUMPARAMS];
153 typedef int (Mamer::*USERFP)  (User *, param_list);
154 typedef int (Mamer::*TOURNFP) (User *, param_list, Tourney *);
155
156 #endif
157