aboutsummaryrefslogtreecommitdiff
path: root/src/board
diff options
context:
space:
mode:
Diffstat (limited to 'src/board')
-rw-r--r--src/board/board.cpp11
-rw-r--r--src/board/board.hpp7
-rw-r--r--src/board/fen.cpp2
-rw-r--r--src/board/fen.hpp2
4 files changed, 7 insertions, 15 deletions
diff --git a/src/board/board.cpp b/src/board/board.cpp
index af313d0..2cd705d 100644
--- a/src/board/board.cpp
+++ b/src/board/board.cpp
@@ -1,16 +1,9 @@
#include "board.hpp"
-#include "../moves.hpp"
-#include "zobrist/zobrist.hpp"
+#include "moves.hpp"
+#include "zobrist.hpp"
#include <cassert>
#include <cstdlib>
-Piece createPiece(PieceType type, bool color) {
- Piece piece;
- piece.type = type;
- piece.color = color;
- return piece;
-}
-
int PositionToIndex(Position i) { return i.rank * 8 + i.file; }
Position FindKing(Game *b, bool color) {
diff --git a/src/board/board.hpp b/src/board/board.hpp
index 5d0d913..bcd0b95 100644
--- a/src/board/board.hpp
+++ b/src/board/board.hpp
@@ -45,9 +45,9 @@ struct Move {
enum Flag { EXACT, LOWERBOUND, UPPERBOUND };
struct TranspositionsEntry {
- int depth;
- int Eval;
- Flag flag;
+ int depth = -1;
+ int Eval = 0;
+ Flag flag = EXACT;
Move bestMove = {};
};
struct Game {
@@ -96,7 +96,6 @@ struct UndoMove {
bool wasCastle = false;
bool CastledSide = false; // 0 for queen side, 1 for king side
};
-Piece createPiece(PieceType type, bool color);
int PositionToIndex(Position i);
UndoMove MakeMove(Move move, Game *g);
diff --git a/src/board/fen.cpp b/src/board/fen.cpp
index faa8f83..a7e65eb 100644
--- a/src/board/fen.cpp
+++ b/src/board/fen.cpp
@@ -11,7 +11,7 @@
bool WHITE = true;
bool BLACK = false;
-void setBoardFen(std::string fen, Game *g) {
+void setBoardFen(const std::string fen, Game *g) {
// example fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
int file = 0;
int rank = 0;
diff --git a/src/board/fen.hpp b/src/board/fen.hpp
index 406f5fe..7af3db3 100644
--- a/src/board/fen.hpp
+++ b/src/board/fen.hpp
@@ -5,5 +5,5 @@
#include "board.hpp"
-void setBoardFen(std::string fen, Game *b);
+void setBoardFen(const std::string fen, Game *b);
#endif /* SRC_FEN_H_ */