|
@@ -0,0 +1,58 @@
|
|
|
+#include "Board.h"
|
|
|
+#include <string>
|
|
|
+
|
|
|
+using namespace chessy;
|
|
|
+
|
|
|
+
|
|
|
+void Board::resetBoard(void)
|
|
|
+{
|
|
|
+ whitePawns = 0x000000000000FF00;
|
|
|
+ whiteRooks = 0x0000000000000081;
|
|
|
+ whiteKnights = 0x0000000000000042;
|
|
|
+ whiteBishops = 0x0000000000000024;
|
|
|
+ whiteQueens = 0x0000000000000010;
|
|
|
+ whiteKing = 0x0000000000000008;
|
|
|
+
|
|
|
+ blackPawns = 0x00FF000000000000;
|
|
|
+ blackRooks = 0x8100000000000000;
|
|
|
+ blackKnights = 0x4200000000000000;
|
|
|
+ blackBishops = 0x2400000000000000;
|
|
|
+ blackQueens = 0x1000000000000000;
|
|
|
+ blackKing = 0x0800000000000000;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+Bitboard Board::getWhites(void) const
|
|
|
+{
|
|
|
+ return
|
|
|
+ whitePawns |
|
|
|
+ whiteRooks |
|
|
|
+ whiteKnights |
|
|
|
+ whiteBishops |
|
|
|
+ whiteQueens |
|
|
|
+ whiteKing;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+Bitboard Board::getBlacks(void) const
|
|
|
+{
|
|
|
+ return
|
|
|
+ blackPawns |
|
|
|
+ blackRooks |
|
|
|
+ blackKnights |
|
|
|
+ blackBishops |
|
|
|
+ blackQueens |
|
|
|
+ blackKing;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+Bitboard Board::getOccupied(void) const
|
|
|
+{
|
|
|
+ return getWhites() | getBlacks();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+Bitboard Board::getFree(void) const
|
|
|
+{
|
|
|
+ return ~getOccupied();
|
|
|
+}
|