forked from ChicoState/GoldenBalls
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
84 lines (68 loc) · 1.35 KB
/
main.cpp
File metadata and controls
84 lines (68 loc) · 1.35 KB
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
78
79
80
81
82
83
84
/*
main.cpp by Subhed Chavan, Jayesh Sathe, Gopal Raigoni @ Chico State
Github @subhed @Jayesh-sathe @gopalsingh112
CSCI-630
*/
#include <iostream>
#include "Game_Type.h"
#include "Human_Player.h"
#include "Computer_Player.h"
#include "Records.h"
#include "Game.h"
using namespace std;
Game_Type select_game_type()
{
cout << "1. Press 1 for Single Player" << endl
<< "2. Press 2 for Dual Player" << endl;
int G_Type;
cin >> G_Type;
label1 : switch (G_Type)
{
case 1:
GT = Game_Type::single;
return GT;
break;
case 2:
GT = Game_Type::dual;
return GT;
break;
default:
goto label1;
break;
}
}
void show_records()
{
Records display = Records::instance();
display.show_records();
}
void show_menu()
{
Game GM;
cout << "1. Press 1 to play the game" << endl
<< "2. Press 2 to see records" << endl;
int G_Menu;
cin >> G_Menu;
label : switch (G_Menu)
{
case 1:
Game_Type GT = select_game_type();
GM(GT);
show_records();
break;
case 2:
show_records();
break;
case 3:
exit(0);
default:
cout<<"You have entered an incorrect entry."<<endl;
goto label;
break;
}
}
int main()
{
show_menu();
return 0;
}