[Board] Move DefinedBoards to BitBoard

This commit is contained in:
2022-12-22 10:34:07 +01:00
parent c66a562886
commit defd74fb63
2 changed files with 18 additions and 15 deletions

View File

@@ -3,9 +3,27 @@
#include <cstdint>
#include <ostream>
#include "Square.hpp"
enum DefinedBoards : uint64_t {
AFile = 0x0101010101010101,
BFile = AFile << 1,
CFile = AFile << 2,
DFile = AFile << 3,
EFile = AFile << 4,
FFile = AFile << 5,
GFile = AFile << 6,
HFile = AFile << 7,
WhiteCastlingRank = (1ULL << A2) - 1,
BlackCastlingRank = (~1ULL << H7),
CastlingRanks = WhiteCastlingRank | BlackCastlingRank,
CastlingSquares = (WhiteCastlingRank | BlackCastlingRank) & (CFile | GFile),
};
class BitBoard final {
public:
using U64 = uint64_t;
BitBoard(U64 v = 0);