diff --git a/src/kode/Tournament.h b/src/kode/Tournament.h index 70faa864c9f78d70a4101726d686970cd9897348..eea16fd92eedd63efa270e24ebe4069f643c961b 100644 --- a/src/kode/Tournament.h +++ b/src/kode/Tournament.h @@ -22,17 +22,18 @@ class Tournament { public : - int nrOfTables; - int currentRound; - int nrOfRounds; - vector<int>white; - vector<int>black; - - virtual void enterResults(); //+ - virtual void endTournament(); //+ - virtual void printTables(); //+ - virtual void createMatchups();//+ - bool canStartRound();//+ + int nrOfTables; //amount of tables in the tournament + int currentRound; //which round we are currently in, is updated in Tournament::printTables + int nrOfRounds; //amount of rounds the tournament has total + vector<int>white; //id of the players with white pieces in the current round, so white[0] is the id of the player with white pieces on table 1 + vector<int>black; //id of the players with black pieces in the current round, so black[0] is the id of the player with black pieces on table 1 + //white and black are reset each round, but still needs to be saved + + virtual void enterResults(); //Enters the results after a round, goes through each table and asks the result before allowing the next round to start + virtual void endTournament(); //Goes if currentround is the final round, prints the final results + virtual void printTables(); //Calls createMatchups and prints the tables + virtual void createMatchups();//Figures out who should play against each other + bool canStartRound();//Controls that the amount of tables and players correspond void writeToFileTournament(ofstream &out); //- void readFromFileTournaments(ifstream &in); //- diff --git a/src/kode/player.h b/src/kode/player.h index 64e8c888ac94eef39fac41f4632d1e8602ea5530..e7f577329c2fb24e4acd8b0e679e16670f566211 100644 --- a/src/kode/player.h +++ b/src/kode/player.h @@ -26,8 +26,8 @@ class Player float score; vector <int> results; //stores the results of each match, 0 for loss, 1 for draw and 2 for win - vector <Player*> playedAgainst; - vector<bool> wasWhite; + vector <Player*> playedAgainst; //has every person they have played against + vector<bool> wasWhite; //true for each round the player had white pieces, false for black Player(); Player(string name, string surName, string clubName, int rating, int playerID, float score);