3dc083f11acc2f0ff12069ecf5d1db46b021b255
[capablanca.git] / lasker-2.2.3 / bots / mamer / TourneyPlayers.hh
1 //--------------------------------------------------------------------------
2 // TourneyPlayers.hh - Class header for the TourneyPlayers class
3 //
4 // Matthew E. Moses & Michael A. Long
5 //
6 // $Revision: 1.6 $
7 // $Date: 1998/09/10 19:58:41 $
8 //
9 // $Author: mlong $
10 // $Locker:  $
11 //
12 // $Log: TourneyPlayers.hh,v $
13 // Revision 1.6  1998/09/10 19:58:41  mlong
14 // lots of little bug fixes and a few new features.
15 //
16 // Revision 1.5  1998/04/29 15:24:07  mlong
17 // prepairing for the move to daimi
18 // new sorting routine.
19 //
20 // Revision 1.4  1998/02/12 18:44:25  mlong
21 // *** empty log message ***
22 //
23 // Revision 1.3  1997/10/28 21:03:48  mlong
24 // *** empty log message ***
25 //
26 // Revision 1.2  1997/10/23 19:56:12  chess
27 // *** empty log message ***
28 //
29 // Revision 1.1  1997/05/14 16:59:13  chess
30 // Initial revision
31 //
32 //
33 //--------------------------------------------------------------------------
34
35 #ifndef _TOURNEYPLAYERS_
36 #define _TOURNEYPLAYERS_
37
38 #include <fstream.h>
39 #include <iostream.h>
40
41 extern "C" {
42 #include <sys/param.h>
43 #include <sys/types.h>
44
45 #include <ctype.h>
46 #include <errno.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include <strings.h>
50 #include <sys/stat.h>
51
52 #include <time.h>
53 #include <unistd.h>
54 }
55
56 #include "config.h"
57 #include "User.hh"
58 #include "link.hh"
59 #include "linklist.hh"
60 #include "Player.hh"
61 #include "types.h"
62
63 class TourneyPlayers : public Link {
64 public:
65   TourneyPlayers(char *, int, float);
66   TourneyPlayers();
67   ~TourneyPlayers();
68   
69   void AddWhite();
70   void AddBlack();
71   void ClearWhites();
72   void ClearBlacks();
73
74   int GetConsecutiveWhites();
75   int GetConsecutiveBlacks();
76   int GetTotalWhites();
77   int GetTotalBlacks();
78   int ColorDue();
79
80   int IsPaired();
81   void NowPaired(int);
82
83   int AlreadyPlayed(char *);
84   void CalculateScore();
85
86   int RemovePotentialOppList();
87   Player *GetOpponentPlayer(char *);
88   void RemoveFromOppList(char *);
89   void RemoveLastOpponent();
90
91 private:
92   void ChangeColorDue(int);
93
94   void CalculatePerform();
95
96 public:
97
98   char name[NAMELEN];
99   int rating;
100   float score;
101   int perform;
102   int upset;
103   int activeFlag;
104   double sortValue;
105   int oppChoice;
106   int location;
107
108   char oppName[NAMELEN];
109
110   LinkList<Player> opponentList;
111   LinkList<Player> potentialOpponentList;
112
113 private:
114
115   int totalWhites;
116   int totalBlacks;
117   int consecutiveWhites;
118   int consecutiveBlacks;
119   int dueColor;
120   int paired;
121
122 };
123
124
125 #endif