1 //--------------------------------------------------------------------------
2 // Tourney.hh - Class header for the Tourney class
4 // Matthew E. Moses & Michael A. Long
7 // $Date: 1998/09/10 19:58:41 $
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);
66 void CloseAndStart(void);
73 int AddPlayer(char *, int, float);
74 int RemovePlayer(char *);
75 void SetVariable(int, int);
76 void SetVariable(int, char *);
78 void CalculateAverage();
81 int GetSortValueCount(double);
82 Player *GetSortPlayer(char *);
83 Player *GetSortPlayer(int);
85 TourneyPlayers *GetPlayer(char *);
89 int GetRoundsRemaining();
90 float GetAverageRating();
92 int MakeAssignments();
94 void SetPairingScores(TourneyPlayers *);
95 TourneyPlayers *FindBestOpponent(TourneyPlayers *);
96 int PairPlayers(TourneyPlayers *, TourneyPlayers *);
97 void UnPairPlayer(TourneyPlayers *);
98 void AssignColors(TourneyPlayers *, TourneyPlayers *);
99 int SetGameResult(char *, char *, int);
104 void SetPersist(int);
107 int PopLastPairedPlayer();
108 void ClearPairedPlayers();
110 void PrintPotentialLists();
116 LinkList<TourneyPlayers> playerList;
117 LinkList<Game> gameList;
118 LinkList<Player> sortList;
119 LinkList<Storage> pairedPlayers;
121 TourneyParameters params;
123 char manager[NAMELEN];
141 //---------------------------------------------------------
142 // $Log: Tourney.hh,v $
143 // Revision 1.11 1998/09/10 19:58:41 mlong
144 // lots of little bug fixes and a few new features.
146 // Revision 1.10 1998/04/29 15:24:07 mlong
147 // prepairing for the move to daimi
148 // new sorting routine.
150 // Revision 1.9 1998/04/18 18:46:31 mlong
151 // fixed delete bug and
152 // added delete tourney function
154 // Revision 1.8 1998/02/12 18:44:25 mlong
155 // *** empty log message ***
157 // Revision 1.7 1997/10/28 21:03:48 mlong
158 // *** empty log message ***
160 // Revision 1.6 1997/10/23 19:56:44 mlong
161 // *** empty log message ***
163 // Revision 1.5 1997/10/23 19:37:22 chess
166 // Revision 1.4 1997/05/15 18:29:12 chess
167 // added pending and TourneyPlayers support
168 // added HandleGetPlayerInfo & HandleGetGameInfo
170 // Revision 1.3 1997/05/02 23:55:18 chess
171 // added TourneyParameters class include
173 // Revision 1.2 1996/10/01 20:14:43 moses
176 // Revision 1.1 1996/09/30 20:52:48 moses
179 //--------------------------------------------------------------------------