forked from EddyVegaGarcia/TP-n-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjuez.cpp
81 lines (48 loc) · 1.98 KB
/
juez.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
78
79
80
81
#include "juez.h"
#include "lista.h"
void Juez::Juez(int cantidadJugadores){
// Hola mati soy aldana y vengo a comentarte todo el código (?) xD. Sí, te dejo comentarios y no lo cambio.
// El juez recibe (cantidadJugadores, ok), como segundo parámetro, un puntero a Mapa.
// Hay que asignar ese puntero que recibiste a un atributo que tiene que tener el juez, un puntero a Mapa.
char caracterDeJugador = 'A';
for(int i=1; i<=cantidadJugadores; i++){
this-> jugadores-> agregar(caracterDeJugador,i);
// Acá adentro insertás el jugador, pero lo tenés que crear. (Por qué no leés el hermoso jugador.h que hice)
// te lo copipasteo, constructor de jugador: "Jugador(char letra, Mapa* punteroAMapa);"
// (o sea la lista es de jugadores, no le agregás un caracter sino un jugador)
}
}
void Juez::avanzarJugador(){
if (this-> jugadores -> cursor == NULL) // afsdfs cursor es un atributo privado
this-> jugadores -> cursor -> iniciarCursor();
else
this-> jugadores -> avanzarCursor();
}
bool Juez::haGanado(Jugador aVerificar){
bool jugadorGano = false;
}
bool Juez::mostrarJugador(){
Jugador actual = this-> jugadores -> obtenerCursor();
std::cout<<"Jugador: "<< Jugador.nombre<< std::endl; // afsfdfdfwe privado, usá los obtener.
// y es "objeto.método()", el nombre del objeto es "actual". "Jugador" es el nombre de la clase.
}
void Juez::insertarJugador(Jugador nuevo){
this-> jugadores -> agregar(nuevo);
}
bool Juez::mostrarPuntaje(){
Jugador actual = this-> jugadores -> obtenerCursor();
std::cout<<"Puntaje:"<< Jugador.puntaje<< std::endl;
}
Juez::~juez(){
while( !(this->jugadores->estaVacia()) ){
jugador* jugadorActual;
char alias;
int puntaje;
this->jugadores->iniciarCursor();
jugadorActual = this->jugadores->obtenerCursor();
alias = jugardorActual->obtenerAlias();
puntaje = jugadorActual->obtenerPuntaje();
cout<<" el jugador : " << alias << "tiene " << puntaje << "puntos." << endl;
this->jugadores->remover(1);
}
}