-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
77 lines (55 loc) · 1.53 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "Player.h"
#include "Team.h"
#include "ImmunityCompetition.h"
#include "Voting.h"
using namespace std;
Team teams[2] = { Team("Red"), Team("Blue")};
int competitionId = 1;
void menu();
void votingDay();
void immunityProcess(int teamChoice);
int main()
{
srand(time(NULL));
menu();
return 0;
}
void menu()
{
int choice = -1;
while(choice != 0)
{
cout << "1.Voting Day." << endl;
cout << "0.Quit" << endl;
cin >> choice;
switch(choice)
{
case 1:
votingDay();
break;
case 0:
break;
default:
cout << "Incorrect Input. Choose between 1 Press 0 to quit." << endl;
}
}
}
void votingDay()
{
cout << "This is voting process in the Master Chef Game." << endl << endl;
int teamChoice = -1;
while (teamChoice != 0 && teamChoice != 1)
{
cout << "Choose Team for immunity competition: 0.Red or 1.Blue" << endl;
cin >> teamChoice;
}
immunityProcess(teamChoice);
Voting::votingProcess(teams[teamChoice]);
}
void immunityProcess(int teamChoice)
{
cout << "This is immunity process in the Survivor Game for " << teams[teamChoice].getColor() << "." << endl << endl;
ImmunityAward immunityAward("Immunity Award", true);
ImmunityCompetition immunityCompetition(competitionId++, "Immunity Competition", immunityAward);
immunityCompetition.compete(teams[teamChoice]);
}