29 #include <unordered_map> 39 std::unique_ptr<char[]> compactStr;
40 std::unique_ptr<char[]> comment;
42 bookDataT(
char* compact,
char* comm)
43 : compactStr(compact), comment(comm) {}
45 std::unordered_multimap<unsigned, bookDataT> pos_;
46 std::vector<const char*> comments_;
47 unsigned LineCount = 0;
48 unsigned LeastMaterial = 32;
61 static std::pair<errorT, std::unique_ptr<PBook> >
86 std::min(ptrdiff_t(6), std::distance(it.first, it.second)),
91 std::string
EcoSummary(
const char* ecoPrefix)
const;
95 size_t Size()
const {
return pos_.size(); }
98 #endif // SCID_PBOOK_H
static std::pair< errorT, std::unique_ptr< PBook > > ReadEcoFile(const char *FileName)
Read a file with a list of ECO codes and creates a PBook object.
ecoT findECO(Position *pos) const
Retrieve the ECO code of a position.
unsigned FewestPieces() const
std::string EcoSummary(const char *ecoPrefix) const
ecoT eco_FromString(const char *ecoStr)
unsigned GetLineNumber() const
std::pair< const char *, const char * > findECOstr(Position *pos) const
Retrieve an ECO string containing the ECO code and the mnemonic name.
A PBook is a collection of chess positions, each with the corresponding ECO code, a mnemonic name...