Line data Source code
1 : #pragma once
2 :
3 : #include "definition.hpp"
4 : #include "position.hpp"
5 :
6 : [[nodiscard]] std::string GetFENShort(const Position &p);
7 :
8 : [[nodiscard]] std::string GetFENShort2(const Position &p);
9 :
10 : [[nodiscard]] std::string GetFEN(const Position &p);
11 :
12 : [[nodiscard]] std::string SanitizeCastling(const Position &p, const std::string &str);
13 :
14 : [[nodiscard]] Square kingSquare(const Position &p);
15 :
16 : ///@todo std::optional to avoid output parameter
17 : bool readMove(const Position &p, const std::string &ss, Square &from, Square &to, MType &moveType, bool forbidCastling = false);
18 :
19 : [[nodiscard]] float gamePhase(const Position::Material &mat, ScoreType &matScoreW, ScoreType &matScoreB);
20 :
21 : [[nodiscard]] bool readEPDFile(const std::string &fileName, std::vector<std::string> &positions);
22 :
23 : struct PerftAccumulator {
24 : Counter pseudoNodes {0};
25 : Counter validNodes {0};
26 : Counter captureNodes {0};
27 : Counter epNodes {0};
28 : Counter checkNode {0};
29 : Counter checkMateNode {0};
30 : Counter castling {0};
31 : Counter promotion {0};
32 : void Display() const;
33 6257709 : PerftAccumulator& operator+=(const PerftAccumulator& acc) {
34 6257709 : pseudoNodes += acc.pseudoNodes;
35 6257709 : validNodes += acc.validNodes;
36 6257709 : captureNodes += acc.captureNodes;
37 6257709 : epNodes += acc.epNodes;
38 6257709 : checkNode += acc.checkNode;
39 6257709 : checkMateNode += acc.checkMateNode;
40 6257709 : castling += acc.castling;
41 6257709 : promotion += acc.promotion;
42 6257709 : return *this;
43 : }
44 : };
45 :
46 : #if !defined(WITH_SMALL_MEMORY)
47 : namespace chess960 {
48 : extern const array1d<std::string,960> positions;
49 : std::string getDFRCXFEN();
50 : }
51 : #endif
|