This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
breakthroughpine64backup/Board.h

119 lines
2.7 KiB
C
Raw Normal View History

2015-10-28 15:13:22 -05:00
<<<<<<< HEAD
#pragma once
#include <iostream>
#include <vector>
2015-10-27 21:52:09 -05:00
#include "Piece.h"
using namespace std;
struct moves {
int row;
2015-10-27 21:52:09 -05:00
int column;
string moveType;
moves(int linea, int columna, string m) {
row = linea;
column = columna;
moveType = m;
}
};
class Board {
2015-10-27 21:52:09 -05:00
vector<Piece*> xpieces;
vector<Piece*> opieces;
vector<Piece*> pieces;
char turn = 'O';
2015-10-27 21:52:09 -05:00
bool valid = false;
public:
Board();
2015-10-27 21:52:09 -05:00
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<Piece*> getXPieces() const { return xpieces; }
vector<Piece*> getOPieces() const { return opieces; }
moves parse(string input);
char getTurn() { return turn; }
bool isGameOver();
void changeTurns();
void displayBoard();
2015-10-27 21:52:09 -05:00
string boardToString();
int charToIntColumn(char input);
char intToCharColumn(int input);
void move(string inputMove);
void move(moves jugada);
2015-10-27 21:52:09 -05:00
void moveWOPrint(moves jugada);
bool isThisMovePossible(int r, int c, string moveType);
vector<moves> viewPossibleMoves();
string myToUpper(string input);
void undo(Board& tablero);
void interpret(string input, Board& tablero);
void snapshot(vector<Board>& inputVec, Board inputBoard);
2015-10-27 21:52:09 -05:00
int evaluate(char max, char min);
};
2015-10-28 15:13:22 -05:00
=======
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;
int column;
2015-10-19 15:45:41 -05:00
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<Piece*> xpieces;
vector<Piece*> opieces;
2015-10-27 11:31:44 -05:00
vector<Piece*> pieces;
2015-10-19 15:36:20 -05:00
char turn = 'O';
bool valid = false;
2015-10-19 15:36:20 -05:00
public:
Board();
2015-10-27 12:55:23 -05:00
Board(const Board& b);
void setValidFalse();
void setValidTrue();
bool isValid();
2015-10-27 11:31:44 -05:00
bool isPiece(int r, int c);
void isTaken(int r, int c);
2015-10-27 11:31:44 -05:00
Piece* getPiece(int r, int c);
2015-10-27 12:55:23 -05:00
vector<Piece*> getXPieces() const { return xpieces; }
vector<Piece*> getOPieces() const { return opieces; }
2015-10-27 21:48:04 -05:00
char getTurnPls() const { return turn; }
2015-10-19 15:36:20 -05:00
moves parse(string input);
char getTurn() { return turn; }
bool isGameOver();
void changeTurns();
void displayBoard();
2015-10-27 11:51:37 -05:00
string boardToString();
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-28 15:13:22 -05:00
};
>>>>>>> master