fmt: reformatted code, changed some function signatures, fairly minor
This commit is contained in:
parent
76c0c3ce8b
commit
21fae88bdb
5 changed files with 216 additions and 50 deletions
|
|
@ -9,39 +9,37 @@
|
|||
#ifndef BOARD_HPP
|
||||
#define BOARD_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Piece.hpp"
|
||||
|
||||
// why do I have to forward declare all these?!
|
||||
class Piece;
|
||||
|
||||
enum Players {
|
||||
PL_WHITE, PL_BLACK
|
||||
};
|
||||
enum Players { PL_WHITE, PL_BLACK };
|
||||
struct Square;
|
||||
|
||||
class Board {
|
||||
private:
|
||||
friend class Piece;
|
||||
Players playerTurn;
|
||||
public:
|
||||
// this should be protected, but even when Piece is declared as a friend,
|
||||
// accessing it in Piece.cpp threw an error
|
||||
std::vector<std::vector<std::unique_ptr<Piece>>> boardGrid;
|
||||
Board();
|
||||
virtual ~Board();
|
||||
void setupInitialPosition();
|
||||
Piece *getPieceAt(Square square);
|
||||
void movePiece(Square from, Square to);
|
||||
int setupFromFEN(std::string strFEN);
|
||||
bool isInBounds(Square square) const;
|
||||
bool isEmpty(Square square) const;
|
||||
uint64_t serialBoard = 0xFFFF00000000FFFF; // opening position
|
||||
void deserializeBoard(uint64_t incomingBoard);
|
||||
|
||||
private:
|
||||
friend class Piece;
|
||||
Players playerTurn;
|
||||
public:
|
||||
// this should be protected, but even when Piece is declared as a friend,
|
||||
// accessing it in Piece.cpp threw an error
|
||||
std::vector<std::vector<std::unique_ptr<Piece>>> boardGrid;
|
||||
Board();
|
||||
virtual ~Board();
|
||||
void setupInitialPosition();
|
||||
std::unique_ptr<Piece> &getPieceAt(Square square);
|
||||
void movePiece(Square from, Square to);
|
||||
int setupFromFEN(std::string strFEN);
|
||||
bool isInBounds(Square square) const;
|
||||
bool isEmpty(Square square) const;
|
||||
uint64_t serialBoard = 0xFFFF00000000FFFF; // opening position
|
||||
void deserializeBoard(uint64_t incomingBoard);
|
||||
};
|
||||
|
||||
#endif // BOARD_HPP
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue