diff --git a/include/game_interface.h b/include/game_interface.h index 931e717..281f130 100644 --- a/include/game_interface.h +++ b/include/game_interface.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include "hanabi_types.hpp" @@ -71,7 +70,7 @@ namespace Hanabi [[nodiscard]] virtual std::uint64_t enumerated_states() const = 0; - [[nodiscard]] virtual const std::unordered_map & position_tablebase() const = 0; + [[nodiscard]] virtual const map_type & position_tablebase() const = 0; virtual void init_backtracking_information() = 0; diff --git a/include/game_state.h b/include/game_state.h index 8e6cc97..6fcf0c7 100644 --- a/include/game_state.h +++ b/include/game_state.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -117,7 +116,7 @@ namespace Hanabi [[nodiscard]] std::uint64_t enumerated_states() const final; - [[nodiscard]] const std::unordered_map & position_tablebase() const final; + [[nodiscard]] const map_type & position_tablebase() const final; void init_backtracking_information() final; @@ -258,7 +257,7 @@ namespace Hanabi RelativeRepresentationData _relative_representation; // Lookup table for states. Uses the ids calculated using the relative representation - std::unordered_map _position_tablebase; + map_type _position_tablebase; std::uint64_t _enumerated_states{}; }; diff --git a/include/game_state.hpp b/include/game_state.hpp index 75b5e3b..06a992e 100644 --- a/include/game_state.hpp +++ b/include/game_state.hpp @@ -1336,7 +1336,7 @@ namespace Hanabi } template - const std::unordered_map & + const map_type & HanabiState::position_tablebase() const { return _position_tablebase; diff --git a/include/hanabi_types.hpp b/include/hanabi_types.hpp index 93980b8..730e6d3 100644 --- a/include/hanabi_types.hpp +++ b/include/hanabi_types.hpp @@ -8,6 +8,8 @@ #include +#include + namespace Hanabi { @@ -20,6 +22,9 @@ namespace Hanabi using probability_base_type = unsigned long; using rational_probability = boost::rational; + template + using map_type = std::unordered_map; + /** * Define macro * NUSE_RATIONAL_PROBABILITIES