2 Stockfish, a UCI chess playing engine derived from Glaurung 2.1
3 Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
4 Copyright (C) 2008 Marco Costalba
6 Stockfish is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Stockfish is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 The code in this file is based on the opening book code in PolyGlot
23 by Fabien Letouzey. PolyGlot is available under the GNU General
24 Public License, and can be downloaded from http://wbec-ridderkerk.nl
28 #if !defined(BOOK_H_INCLUDED)
29 #define BOOK_H_INCLUDED
61 // Open and close book files
62 void open(const std::string &fName);
65 // Testing if a book is opened
68 // The file name of the currently active book
69 const std::string file_name() const;
71 // Get a book move for a given position
72 Move get_move(const Position &pos) const;
75 int find_key(uint64_t key) const;
76 void read_entry(BookEntry &entry, int n) const;
79 mutable std::ifstream bookFile;
88 extern Book OpeningBook;
91 #endif // !defined(BOOK_H_INCLUDED)