aboutsummaryrefslogtreecommitdiff
path: root/src/board/fen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/board/fen.cpp')
-rw-r--r--src/board/fen.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/board/fen.cpp b/src/board/fen.cpp
index dd503e0..e020e78 100644
--- a/src/board/fen.cpp
+++ b/src/board/fen.cpp
@@ -48,7 +48,14 @@ static void clearBoard(Game *g) {
g->whiteCastleKing = false;
g->whiteCastleQueen = false;
}
-
+enum parserState : std::uint8_t {
+ BOARD,
+ PLAYER_TO_MOVE,
+ CASTLE,
+ ENPASSANT,
+ HALF_MOVE_CLOCK,
+ FULL_MOVE_CLOCK,
+};
void setBoardFen(const std::string &fen, Game *g) {
clearBoard(g);
// example fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
@@ -56,14 +63,7 @@ void setBoardFen(const std::string &fen, Game *g) {
int rank = 7;
Position enpassant = {};
- enum parserState : std::uint8_t {
- BOARD,
- PLAYER_TO_MOVE,
- CASTLE,
- ENPASSANT,
- HALF_MOVE_CLOCK,
- FULL_MOVE_CLOCK,
- };
+
parserState parser_state = BOARD;
for (uint i = 0; i < fen.length(); i++) {