From c50deb074b8f9f18aad67799df56eac856425998 Mon Sep 17 00:00:00 2001
From: TheHresvelgian <sigrunhog@hotmail.com>
Date: Wed, 27 Apr 2022 00:00:31 +0200
Subject: [PATCH] Organizing code

---
 src/kode/Tournament.cpp | 29 +++++++++++++++++++++++++++++
 src/kode/searchByID.cpp |  1 +
 2 files changed, 30 insertions(+)

diff --git a/src/kode/Tournament.cpp b/src/kode/Tournament.cpp
index 6499644..d02dede 100644
--- a/src/kode/Tournament.cpp
+++ b/src/kode/Tournament.cpp
@@ -11,6 +11,7 @@
 #include <fstream>  //  ifstream, ofstream
 #include "LesData2.h"
 #include "player.h"
+#include "functions.h"
 
 using namespace std;
 
@@ -48,7 +49,10 @@ void Tournament::startNewTournament()
 
 void Tournament::enterResults()
 {
+    for (int i = 0; i < nrOfTables; ++i)
+    {
 
+    }
 }
 
 void Tournament::printTables()
@@ -59,6 +63,31 @@ void Tournament::printTables()
              << " please add or remove players so that there is exactly two players per table." << endl;
         return;
     }
+    white.clear();
+    black.clear();
+
+    currentRound++;
+    if(currentRound==1)
+    {
+        vector<Player*> playersPlaying = playerList;
+        for (int i = 0; i < nrOfTables; ++i)
+        {
+            white.push_back(playersPlaying[playersPlaying.size()-1]->playerID);
+            playersPlaying.pop_back();
+            black.push_back(playersPlaying[playersPlaying.size()-1]->playerID);
+            playersPlaying.pop_back();
+            cout << endl << "Table " << i << ": \t"
+            <<
+        }
+    }
+    else
+    {
+        vector<Player*> playersPlaying = sortedRankings;
+        sortRanking();
+        do {
+
+        }while(playersPlaying > 0);
+    }
 }
 
 bool Tournament::canStartRound()
diff --git a/src/kode/searchByID.cpp b/src/kode/searchByID.cpp
index 9f68cd5..2e84d62 100644
--- a/src/kode/searchByID.cpp
+++ b/src/kode/searchByID.cpp
@@ -11,6 +11,7 @@ int searchByID(int id, int list)
     vector<Player*> listToUse;
     if (list == 1)
     {
+        listToUse=playerList;
     }
     else if (list == 2)
     {
-- 
GitLab