1 //--------------------------------------------------------------------------
2 // Tourney.hh - Class header for the Tourney class
4 // Matthew E. Moses & Michael A. Long
7 // $Date: 2002/07/02 00:02:40 $
12 //--------------------------------------------------------------------------
17 #define log22(x) (log(x)/log(2))
23 #include <sys/param.h>
24 #include <sys/types.h>
40 #include "linklist.hh"
42 #include "TourneyParameters.hh"
43 #include "TourneyPlayers.hh"
47 class Tourney : public Link {
50 Tourney(int, User *, TourneyParameters *);
51 Tourney(int, User *, TourneyParameters *, int, int, char, char, int);
52 Tourney(int, User *, TourneyParameters *, int, int, char, char, int, char);
55 void InitTourney(int, User *, int, int, char, char, int, char, int, int);
59 void TellThemWhoTheyPlay(void);
63 short IsNotClosed(void);
65 void CloseAndStart(void);
71 int AddPlayer(char *, int, float);
72 int RemovePlayer(char *);
73 void SetVariable(int, int);
74 void SetVariable(int, char *);
76 void CalculateAverage();
79 int GetSortValueCount(double);
80 Player *GetSortPlayer(char *);
81 Player *GetSortPlayer(int);
83 TourneyPlayers *GetPlayer(char *);
87 int GetRoundsRemaining();
88 float GetAverageRating();
90 int MakeAssignments();
92 void SetPairingScores(TourneyPlayers *);
93 TourneyPlayers *FindBestOpponent(TourneyPlayers *);
94 int PairPlayers(TourneyPlayers *, TourneyPlayers *);
95 void UnPairPlayer(TourneyPlayers *);
96 void AssignColors(TourneyPlayers *, TourneyPlayers *);
97 int SetGameResult(char *, char *, int);
102 void SetPersist(int);
105 int PopLastPairedPlayer();
106 void ClearPairedPlayers();
108 void PrintPotentialLists();
114 LinkList<TourneyPlayers> playerList;
115 LinkList<Game> gameList;
116 LinkList<Player> sortList;
117 LinkList<Storage> pairedPlayers;
119 TourneyParameters params;
121 char manager[NAMELEN];
138 //---------------------------------------------------------
139 // $Log: Tourney.hh,v $
140 // Revision 1.12 2002/07/02 00:02:40 tridge
141 // - fixed compile on g++ 2.96
142 // - updated for lasker 'rmatch'
144 // Revision 1.11 1998/09/10 19:58:41 mlong
145 // lots of little bug fixes and a few new features.
147 // Revision 1.10 1998/04/29 15:24:07 mlong
148 // prepairing for the move to daimi
149 // new sorting routine.
151 // Revision 1.9 1998/04/18 18:46:31 mlong
152 // fixed delete bug and
153 // added delete tourney function
155 // Revision 1.8 1998/02/12 18:44:25 mlong
156 // *** empty log message ***
158 // Revision 1.7 1997/10/28 21:03:48 mlong
159 // *** empty log message ***
161 // Revision 1.6 1997/10/23 19:56:44 mlong
162 // *** empty log message ***
164 // Revision 1.5 1997/10/23 19:37:22 chess
167 // Revision 1.4 1997/05/15 18:29:12 chess
168 // added pending and TourneyPlayers support
169 // added HandleGetPlayerInfo & HandleGetGameInfo
171 // Revision 1.3 1997/05/02 23:55:18 chess
172 // added TourneyParameters class include
174 // Revision 1.2 1996/10/01 20:14:43 moses
177 // Revision 1.1 1996/09/30 20:52:48 moses
180 //--------------------------------------------------------------------------