dev: hardware init code added. starting to write Board methods

This commit is contained in:
A.M. Rowsell 2025-08-02 13:32:16 -04:00
commit d6eb6b69c2
Signed by untrusted user who does not match committer: amr
GPG key ID: E0879EDBDB0CA7B1
4 changed files with 135 additions and 34 deletions

View file

@ -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);