Skip to content
Snippets Groups Projects
Commit ac7c09d0 authored by Bolla Péter's avatar Bolla Péter
Browse files

Upload New File

parent 6f1271fc
Branches
No related tags found
No related merge requests found
#ifndef CHESS_HPP
#define CHESS_HPP
#include <vector>
enum Type{
Pawn, Rook, Knight, Bishop, King, Queen, Empty
};
enum Team{
Light, Dark, None
};
struct Piece{
Type type;
Team team;
};
enum Color{
White, Black
};
struct Square{ //the squares of the chess table
Piece piece; //if there's a piece on the square this variable contains the infos, else it's Empty-None
Color color; //the color of the square on the table (I could calculate from the row/column but it's simpler to store it here)
bool occupied; //true if there's a piece on the square, false if not
int row, column; //the row and column coordinates
};
class Chess
{
public:
Chess(int, int);
void Move(int, int);
void Capture(int, int);
bool Occupied(int, int);
Piece GetPiece(int, int);
Color GetColor(int, int);
Square GetSquare(int, int);
bool Opponents(int, int);
bool CanCapture(int, int);
~Chess();
protected:
std::vector<Square> Table;
int WID, HEIG;
};
#endif // CHESS_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment