X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.h;h=d0a5a97e08a42dced2b9a29a7e081d9a9d657b0a;hp=81afb2e55478ccbd62764c009d43f3cbf7cdc22f;hb=d39bc2efa197ba2fd55b68eced1c60bcfe2facc1;hpb=4a7b8180ecaef7d164fa53a1d545372df1173596 diff --git a/src/endgame.h b/src/endgame.h index 81afb2e5..d0a5a97e 100644 --- a/src/endgame.h +++ b/src/endgame.h @@ -91,7 +91,7 @@ struct Endgame : public EndgameBase { }; -/// The Endgames class stores the pointers to endgame evaluation and scaling +/// The Endgames namespace handles the pointers to endgame evaluation and scaling /// base objects in two std::map. We use polymorphism to invoke the actual /// endgame function by calling its virtual operator(). @@ -99,9 +99,11 @@ namespace Endgames { template using Ptr = std::unique_ptr>; template using Map = std::map>; - + extern std::pair, Map> maps; + void init(); + template Map& map() { return std::get::value>(maps); @@ -119,8 +121,6 @@ namespace Endgames { const EndgameBase* probe(Key key) { return map().count(key) ? map()[key].get() : nullptr; } - - void init(); } #endif // #ifndef ENDGAME_H_INCLUDED