Update Board.h
This commit is contained in:
parent
934a28bec7
commit
30af60d193
1 changed files with 18 additions and 7 deletions
25
Board.h
25
Board.h
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "Piece.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
struct moves {
|
struct moves {
|
||||||
int row;
|
int row;
|
||||||
char column;
|
int column;
|
||||||
string moveType;
|
string moveType;
|
||||||
|
|
||||||
moves(int linea, int columna, string m) {
|
moves(int linea, int columna, string m) {
|
||||||
|
@ -18,29 +19,39 @@ struct moves {
|
||||||
};
|
};
|
||||||
|
|
||||||
class Board {
|
class Board {
|
||||||
char boardArray [8][8];
|
vector<Piece*> xpieces;
|
||||||
|
vector<Piece*> opieces;
|
||||||
|
vector<Piece*> pieces;
|
||||||
char turn = 'O';
|
char turn = 'O';
|
||||||
|
bool valid = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Board();
|
Board();
|
||||||
char elementAt(int r, int k) { return boardArray[r][k]; }
|
Board(const Board& b);
|
||||||
void modifyAt(int r, int k, char input) { boardArray[r][k] = input; }
|
void setValidFalse();
|
||||||
|
void setValidTrue();
|
||||||
|
bool isValid();
|
||||||
|
bool isPiece(int r, int c);
|
||||||
|
void isTaken(int r, int c);
|
||||||
|
Piece* getPiece(int r, int c);
|
||||||
|
vector<Piece*> getXPieces() const { return xpieces; }
|
||||||
|
vector<Piece*> getOPieces() const { return opieces; }
|
||||||
moves parse(string input);
|
moves parse(string input);
|
||||||
char getTurn() { return turn; }
|
char getTurn() { return turn; }
|
||||||
bool isGameOver();
|
bool isGameOver();
|
||||||
void changeTurns();
|
void changeTurns();
|
||||||
void displayBoard();
|
void displayBoard();
|
||||||
|
string boardToString();
|
||||||
int charToIntColumn(char input);
|
int charToIntColumn(char input);
|
||||||
char intToCharColumn(int input);
|
char intToCharColumn(int input);
|
||||||
void move(string inputMove);
|
void move(string inputMove);
|
||||||
void move(moves jugada);
|
void move(moves jugada);
|
||||||
|
void moveWOPrint(moves jugada);
|
||||||
bool isThisMovePossible(int r, int c, string moveType);
|
bool isThisMovePossible(int r, int c, string moveType);
|
||||||
vector<moves> viewPossibleMoves();
|
vector<moves> viewPossibleMoves();
|
||||||
string myToUpper(string input);
|
string myToUpper(string input);
|
||||||
void displayPossibleMoves(vector<moves> input);
|
|
||||||
void undo(Board& tablero);
|
void undo(Board& tablero);
|
||||||
void interpret(string input, Board& tablero);
|
void interpret(string input, Board& tablero);
|
||||||
void snapshot(vector<Board>& inputVec, Board inputBoard);
|
void snapshot(vector<Board>& inputVec, Board inputBoard);
|
||||||
void easyAI();
|
int evaluate(char max, char min);
|
||||||
string boardToString();
|
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue