From 30af60d19389541e75d7ec7f2b06abac37be7f15 Mon Sep 17 00:00:00 2001 From: Brandon Jackson <1drummer@att.net> Date: Tue, 27 Oct 2015 21:52:09 -0500 Subject: [PATCH] Update Board.h --- Board.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Board.h b/Board.h index cad2497..44becfc 100644 --- a/Board.h +++ b/Board.h @@ -2,12 +2,13 @@ #include #include +#include "Piece.h" using namespace std; struct moves { int row; - char column; + int column; string moveType; moves(int linea, int columna, string m) { @@ -18,29 +19,39 @@ struct moves { }; class Board { - char boardArray [8][8]; + vector xpieces; + vector opieces; + vector pieces; char turn = 'O'; + bool valid = false; public: Board(); - char elementAt(int r, int k) { return boardArray[r][k]; } - void modifyAt(int r, int k, char input) { boardArray[r][k] = input; } + Board(const Board& b); + 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 getXPieces() const { return xpieces; } + vector getOPieces() const { return opieces; } moves parse(string input); char getTurn() { return turn; } bool isGameOver(); void changeTurns(); void displayBoard(); + string boardToString(); int charToIntColumn(char input); char intToCharColumn(int input); void move(string inputMove); void move(moves jugada); + void moveWOPrint(moves jugada); bool isThisMovePossible(int r, int c, string moveType); vector viewPossibleMoves(); string myToUpper(string input); - void displayPossibleMoves(vector input); void undo(Board& tablero); void interpret(string input, Board& tablero); void snapshot(vector& inputVec, Board inputBoard); - void easyAI(); - string boardToString(); + int evaluate(char max, char min); };