Let mamer take colors into account for pairing
[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>
39 #include <iostream>
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   void ClearTotalWhites();
74   void ClearTotalBlacks();
75
76   int GetConsecutiveWhites();
77   int GetConsecutiveBlacks();
78   int GetTotalWhites();
79   int GetTotalBlacks();
80   int ColorDue();
81
82   int IsPaired();
83   void NowPaired(int);
84
85   int AlreadyPlayed(char *);
86   void CalculateScore();
87
88   int RemovePotentialOppList();
89   Player *GetOpponentPlayer(char *);
90   void RemoveFromOppList(char *);
91   void RemoveLastOpponent();
92
93 private:
94   void ChangeColorDue(int);
95
96   void CalculatePerform();
97
98 public:
99
100   char name[NAMELEN];
101   int rating;
102   float score;
103   int perform;
104   int upset;
105   int activeFlag;
106   double sortValue;
107   int oppChoice;
108   int location;
109
110   char oppName[NAMELEN];
111
112   LinkList<Player> opponentList;
113   LinkList<Player> potentialOpponentList;
114
115 private:
116
117   int totalWhites;
118   int totalBlacks;
119   int consecutiveWhites;
120   int consecutiveBlacks;
121   int dueColor;
122   int paired;
123
124 };
125
126
127 #endif