2015-10-19 15:36:20 -05:00
|
|
|
#pragma once
|
|
|
|
|
2015-10-19 15:56:21 -05:00
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
2015-10-27 10:40:55 -05:00
|
|
|
#include "Piece.h"
|
2015-10-19 15:56:21 -05:00
|
|
|
|
2015-10-19 15:36:20 -05:00
|
|
|
using namespace std;
|
|
|
|
|
2015-10-19 15:45:41 -05:00
|
|
|
struct moves {
|
|
|
|
int row;
|
|
|
|
char column;
|
|
|
|
string moveType;
|
|
|
|
|
|
|
|
moves(int linea, int columna, string m) {
|
|
|
|
row = linea;
|
|
|
|
column = columna;
|
|
|
|
moveType = m;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-10-19 15:36:20 -05:00
|
|
|
class Board {
|
2015-10-27 10:40:55 -05:00
|
|
|
//vector<vector<char>> boardArray;
|
|
|
|
vector<Piece*> xpieces;
|
|
|
|
vector<Piece*> opieces;
|
2015-10-27 11:31:44 -05:00
|
|
|
vector<Piece*> pieces;
|
2015-10-27 10:40:55 -05:00
|
|
|
//char boardArray [8][8];
|
2015-10-19 15:36:20 -05:00
|
|
|
char turn = 'O';
|
|
|
|
|
|
|
|
public:
|
|
|
|
Board();
|
2015-10-27 11:31:44 -05:00
|
|
|
bool isPiece(int r, int c);
|
|
|
|
Piece* getPiece(int r, int c);
|
2015-10-19 15:36:20 -05:00
|
|
|
moves parse(string input);
|
|
|
|
char getTurn() { return turn; }
|
|
|
|
bool isGameOver();
|
|
|
|
void changeTurns();
|
|
|
|
void displayBoard();
|
2015-10-19 15:45:41 -05:00
|
|
|
int charToIntColumn(char input);
|
|
|
|
char intToCharColumn(int input);
|
2015-10-27 11:31:44 -05:00
|
|
|
void move(string inputMove);
|
|
|
|
void move(moves jugada);
|
2015-10-27 08:38:25 -05:00
|
|
|
void moveWOPrint(moves jugada);
|
2015-10-27 11:31:44 -05:00
|
|
|
bool isThisMovePossible(int r, int c, string moveType);
|
|
|
|
vector<moves> viewPossibleMoves();
|
2015-10-19 15:45:41 -05:00
|
|
|
string myToUpper(string input);
|
2015-10-19 16:37:20 -05:00
|
|
|
void undo(Board& tablero);
|
|
|
|
void interpret(string input, Board& tablero);
|
|
|
|
void snapshot(vector<Board>& inputVec, Board inputBoard);
|
2015-10-27 10:40:55 -05:00
|
|
|
int evaluate(char max, char min);
|
2015-10-19 15:36:20 -05:00
|
|
|
};
|