Skip to content
Snippets Groups Projects
Commit 34319c89 authored by TheHresvelgian's avatar TheHresvelgian
Browse files

played against now stores playerIDs instead of pointers to enable saving

parent 1963920e
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,8 @@ void Tournament::enterResults() ...@@ -29,8 +29,8 @@ void Tournament::enterResults()
cout << endl << "Enter results for round " << currentRound; cout << endl << "Enter results for round " << currentRound;
for (int i = 0; i < nrOfTables; ++i) for (int i = 0; i < nrOfTables; ++i)
{ {
playerList[searchByID(white[i],playerList)]->playedAgainst.push_back( playerList[searchByID(black[i],playerList)]); playerList[searchByID(white[i],playerList)]->playedAgainst.push_back( playerList[searchByID(black[i],playerList)]->playerID);
playerList[searchByID(black[i],playerList)]->playedAgainst.push_back(playerList[searchByID(white[i],playerList)]); playerList[searchByID(black[i],playerList)]->playedAgainst.push_back(playerList[searchByID(white[i],playerList)]->playerID);
playerList[searchByID(white[i],playerList)]->white++; playerList[searchByID(white[i],playerList)]->white++;
int answer; int answer;
cout << endl << "Enter results for table " << i+1 << "with " cout << endl << "Enter results for table " << i+1 << "with "
......
...@@ -27,7 +27,7 @@ class Player ...@@ -27,7 +27,7 @@ class Player
float score; float score;
vector <int> results; //stores the results of each match, 0 for loss, 1 for draw and 2 for win vector <int> results; //stores the results of each match, 0 for loss, 1 for draw and 2 for win
vector <Player*> playedAgainst; //has every person they have played against vector <int> playedAgainst; //has every person they have played against
Player(); Player();
Player(string name, string surName, string clubName, int rating, int playerID, float score); Player(string name, string surName, string clubName, int rating, int playerID, float score);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment