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

added "no player exists" messag

parent 55c48b68
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,11 @@ extern vector<Player*> sortedRankings;
void Tournament::enterResults()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
cout << endl << "Enter results for round " << currentRound;
for (int i = 0; i < nrOfTables; ++i)
{
......@@ -68,6 +73,12 @@ void Tournament::enterResults()
void Tournament::printTables()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
if(canStartRound() == false)
{
cout << endl << "There number of tables does not correspond to the amount of players,"
......
......@@ -11,6 +11,11 @@ extern vector<Player*>playerList;
void deletePlayer()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
int choice = 0;
int id;
int index = -1;
......
......@@ -16,6 +16,11 @@ extern vector<Player*> playerList;
*/
void editPlayer()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
int choice = 0;
int id;
int index = -1;
......
......@@ -14,6 +14,11 @@ extern vector<Player*> sortedRankings;
void printRanking()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
sortRanking();
float currentScoreTP = sortedRankings[0]->score;
int currentPlace = 1;
......
......@@ -8,6 +8,10 @@ extern vector<Player*> sortedRankings;
int searchByID(int id, int list)
{
if (playerList.size()==0)
{
return -2;
}
vector<Player*> listToUse;
if (list == 1)
{
......
......@@ -8,6 +8,10 @@ extern vector<Player*> playerList;
int searchByName(string name)
{
if (playerList.size()==0)
{
return -2;
}
vector<Player*> searchlist;
string playerName;
int findSize = 0;
......
......@@ -12,6 +12,11 @@ extern vector<Player*> playerList;
*/
void viewPlayers()
{
if (playerList.size()==0)
{
cout << endl << "No player's exist.";
return;
}
cout << endl << "Last name" << "\t"
<< "Player ID" << "\t"
<< "Club" << "\t"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment