From a0dcf35504256d5eea3e78f9fd7ca57c74df0f31 Mon Sep 17 00:00:00 2001 From: TheHresvelgian <sigrunhog@hotmail.com> Date: Thu, 28 Apr 2022 16:36:51 +0200 Subject: [PATCH] commenting --- src/kode/Tournament.h | 23 ++++++++++++----------- src/kode/player.h | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/kode/Tournament.h b/src/kode/Tournament.h index 70faa86..eea16fd 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 64e8c88..e7f5773 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); -- GitLab