-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
51 lines (44 loc) · 1.73 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <stdlib.h>
#include <iomanip>
#include <string>
#include "Tournaments/asia_tournament.h"
#include "Tournaments/euro_tournament.h"
#include "Tournaments/africa_tournament.h"
#include "user_interface.h"
int main()
{
int choice;
Tournament* tournament;
InitialRound initialRound;
UserInterface userInterface;
while (true)
{
system("clear");
userInterface.print("Select a tournament to simulate:\n",userInterface.COLOR_YELLOW);
userInterface.print("1. Euro\n",userInterface.COLOR_RED);
userInterface.print("2. Africa\n",userInterface.COLOR_RED);
userInterface.print("3. Asia\n",userInterface.COLOR_RED);
std::cin >> choice;
if (choice == 1)
tournament = new EuroTournament();
else if (choice == 2)
tournament = new AfricaTournament();
else if (choice == 3)
tournament = new AsiaTournament();
userInterface.print("\nSelect a starting stage\n",userInterface.COLOR_YELLOW);
userInterface.print("1. Quarter-Final\n",userInterface.COLOR_RED);
userInterface.print("2. Semi-Final\n",userInterface.COLOR_RED);
userInterface.print("3. Final\n",userInterface.COLOR_RED);
std::cin >> choice;
initialRound = choice == 1 ? QUARTER_FINAL : choice == 2 ? SEMI_FINAL : FINAL;
tournament->simulateTournament(initialRound);
userInterface.print("\nWhat would you like to do next?\n",userInterface.COLOR_YELLOW);
userInterface.print("1. Back to menu\n",userInterface.COLOR_BLUE);
userInterface.print("2. Close\n",userInterface.COLOR_RED);
std::cin >> choice;
if (choice == 2)
break;
}
return 0;
}