-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (30 loc) · 996 Bytes
/
main.cpp
File metadata and controls
41 lines (30 loc) · 996 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
#include <iostream>
#include <thread>
#include <sys/unistd.h>
#include <time.h> //agregamos librería para generar randoms distintos
#include <vector>
#include <mutex>
#include "gameMaster.h"
#include "equipo.h"
#include "definiciones.h"
#include "config.h"
using namespace std;
const estrategia strat = USTEDES;
int main() {
Config config = *(new Config());
gameMaster belcebu = gameMaster(config);
// Creo equipos (lanza procesos)
int quantum = 5;
Equipo rojo(&belcebu, ROJO, strat, config.cantidad_jugadores, quantum, config.pos_rojo);
Equipo azul(&belcebu, AZUL, strat, config.cantidad_jugadores, quantum, config.pos_azul);
rojo.comenzar();
azul.comenzar();
rojo.terminar();
azul.terminar();
//belcebu.play();
if(belcebu.ganador == ROJO || belcebu.ganador == AZUL){
cout << "Bandera capturada por el equipo "<< belcebu.ganador << ". Felicidades!" << endl;
} else{
cout << "Juego finalizado en empate" <<endl;
}
}