+ template<EndgameType E, typename T = EndgameBase<typename eg_fun<E>::type>>
+ void add(const std::string& code);
+
+ template<typename T, int I = std::is_same<T, EndgameBase<ScaleFactor>>::value>
+ Map<T>& map() { return std::get<I>(maps); }
+
+ std::pair<Map<EndgameBase<Value>>, Map<EndgameBase<ScaleFactor>>> maps;
+
+public:
+ Endgames();
+
+ template<typename T> T* probe(Key key, T** eg)
+ { return *eg = map<T>().count(key) ? map<T>()[key].get() : nullptr; }
+};