forked from Mici7120/code-legends
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.cpp
More file actions
48 lines (40 loc) · 954 Bytes
/
menu.cpp
File metadata and controls
48 lines (40 loc) · 954 Bytes
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
#include "menu.h"
Menu::Menu(){
}
void Menu::Interfaz(){
int opcion;
do{
cout << "\n1. Nueva Partida\n2. Cargar Partida\n3. Instrucciones\n4. Exit\n";
cin >> opcion;
switch(opcion){
case 1:
cout << "\nNueva Partida:\n";
configurarPartida(0);
break;
case 2:
cout << "\nCargar Partida:\n";
configurarPartida(1);
break;
case 3:
cout << "\nInstrucciones:\n";
Instrucciones();
break;
case 4:
exit(1);
}
}
while(opcion != 4);
}
void Menu::configurarPartida(int tipoConfiguracion){
tableroGuardado.configurarPartida(tipoConfiguracion);
tableroGuardado.Interfaz();
}
void Menu::Instrucciones(){
string imprimirInstrucciones;
ifstream archivoInstrucciones;
archivoInstrucciones.open("Instrucciones.txt");
while(getline(archivoInstrucciones, imprimirInstrucciones)){
cout << imprimirInstrucciones << endl;
}
archivoInstrucciones.close();
}