dev: hardware init code added. starting to write Board methods
This commit is contained in:
parent
25c351be04
commit
d6eb6b69c2
4 changed files with 135 additions and 34 deletions
10
Board.hpp
10
Board.hpp
|
|
@ -9,19 +9,25 @@
|
|||
#define BOARD_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
#include "Piece.hpp"
|
||||
|
||||
// why do I have to forward declare all these?!
|
||||
class Piece;
|
||||
enum Players { PL_WHITE, PL_BLACK };
|
||||
struct Square;
|
||||
|
||||
class Board {
|
||||
private:
|
||||
std::vector<std::vector<Piece *>> boardGrid;
|
||||
std::vector<std::vector<std::unique_ptr<Piece>>> boardGrid;
|
||||
|
||||
public:
|
||||
Board();
|
||||
~Board();
|
||||
void setupInitialPosition();
|
||||
Piece *getPieceAt(int x, int y) const;
|
||||
void movePiece(int fromX, int fromY, int toX, int toY);
|
||||
void movePiece(Square from, Square to);
|
||||
bool isInBounds(int x, int y) const;
|
||||
uint64_t serialBoard = 0xFFFF00000000FFFF; // opening position
|
||||
void deserializeBoard(uint64_t incomingBoard);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue