-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTablero.h
More file actions
42 lines (37 loc) · 1006 Bytes
/
Copy pathTablero.h
File metadata and controls
42 lines (37 loc) · 1006 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
// Tablero.h
#ifndef TABLERO_H
#define TABLERO_H
#include <vector>
#include <random>
#include <tuple>
#include <string>
struct NodoTablero {
char valor; // 'o', ' ', 'P', 'T', '#', '|'
bool descubierto;
int tesoro_tipo;
NodoTablero *up, *down, *left, *right;
NodoTablero();
};
class Tablero {
private:
int filas, cols;
NodoTablero* inicio;
std::mt19937 rng;
NodoTablero* getPos(int r, int c);
public:
Tablero(int f = 9, int c = 9);
~Tablero();
void construir();
void colocarTesoros(int N = 10);
void colocarJugadorAleatorio(int &outR, int &outC);
void imprimir();
std::tuple<bool,std::string,bool,int> moverJugador(int curR, int curC, char cmd, int &newR, int &newC);
void recubrir();
bool reubicarTesoro(int tipo);
int eliminarMurosAleatorios(int nMuros);
bool teletransportarJugador(int &curR, int &curC);
int getFilas() const;
int getCols() const;
NodoTablero* getNodo(int r,int c);
};
#endif // TABLERO_H