diff --git a/.gitignore b/.gitignore index 5de3e82..3ac12ed 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,5 @@ chessmcu_default/ localTest/ docs/ -.ca/ \ No newline at end of file +.ca/ +*.kate-swp \ No newline at end of file diff --git a/inc/Board.hpp b/inc/Board.hpp index abf53ae..6bf34b7 100644 --- a/inc/Board.hpp +++ b/inc/Board.hpp @@ -32,15 +32,15 @@ class Board { return boardGrid[r][f]; } - const std::unique_ptr& at(int r, int f) const { + const std::unique_ptr &at(int r, int f) const { return boardGrid[r][f]; } - std::unique_ptr& at(const Square& sq) { + std::unique_ptr &at(const Square& sq) { return boardGrid[static_cast(sq.rank)][static_cast(sq.file)]; } - const std::unique_ptr& at(const Square& sq) const { + const std::unique_ptr &at(const Square& sq) const { return boardGrid[static_cast(sq.rank)][static_cast(sq.file)]; } public: @@ -49,23 +49,43 @@ class Board { // These are to allow Piece to access Board in a controlled way // ----- Getters ----- - Piece* getPieceAt(int r, int f) { return at(r, f).get(); } - const Piece* getPieceAt(int r, int f) const { return at(r, f).get(); } + Piece* getPieceAt(int r, int f) { + return at(r, f).get(); + } + const Piece* getPieceAt(int r, int f) const { + return at(r, f).get(); + } - Piece* getPieceAt(const Square& sq) { return at(sq).get(); } - const Piece* getPieceAt(const Square& sq) const { return at(sq).get(); } + Piece* getPieceAt(const Square& sq) { + return at(sq).get(); + } + const Piece* getPieceAt(const Square& sq) const { + return at(sq).get(); + } // ----- Setters ----- - void setPieceAt(int r, int f, std::unique_ptr piece) { at(r, f) = std::move(piece); } - void setPieceAt(const Square& sq, std::unique_ptr piece) { at(sq) = std::move(piece); } + void setPieceAt(int r, int f, std::unique_ptr piece) { + at(r, f) = std::move(piece); + } + void setPieceAt(const Square& sq, std::unique_ptr piece) { + at(sq) = std::move(piece); + } - void clearSquare(int r, int f) { at(r, f).reset(); } - void clearSquare(const Square& sq) { at(sq).reset(); } + void clearSquare(int r, int f) { + at(r, f).reset(); + } + void clearSquare(const Square& sq) { + at(sq).reset(); + } // ----- Utility ----- - bool isSquareEmpty(int r, int f) const { return at(r, f) == nullptr; } - bool isSquareEmpty(const Square& sq) const { return at(sq) == nullptr; } - + bool isSquareEmpty(int r, int f) const { + return at(r, f) == nullptr; + } + bool isSquareEmpty(const Square& sq) const { + return at(sq) == nullptr; + } + void setupInitialPosition(); void clearBoard(); diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml deleted file mode 100644 index bda203e..0000000 --- a/nbproject/configurations.xml +++ /dev/null @@ -1,860 +0,0 @@ - - - - - inc/strFuncs.hpp - inc/Board.hpp - inc/NeoPixel.hpp - inc/Piece.hpp - - - - - chessmcu_default/components/dfp.yml - chessmcu_default/components/core.yml - - chessmcu_default/mcc-config.mc4 - - Makefile - - - - - - - main.cpp - Board.cpp - Piece.cpp - NeoPixel.cpp - graphics.cpp - strFuncs.cpp - - - - . - inc - - Makefile - - - - localhost - PIC32MX270F256B - - - snap - XC32 - 4.60 - 2 - - - - - - - - - - - - - - - false - false - - - - - - - false - false - - false - - false - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - PIC32MX270F256B - - - noID - XC32 - 4.60 - 2 - - - - - - - - - - - - - - - false - true - - - - - - - false - false - - false - - false - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - PIC32MM0256GPM028 - - - noID - XC32 - 4.60 - 2 - - - - - - - - - - - - - - - false - true - - - - - - - false - false - - false - - false - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -