add missing draw pile function

This commit is contained in:
Maximilian Keßler 2023-08-08 00:31:16 +02:00
parent a77de7efe8
commit 548bb371ff
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 7 additions and 0 deletions

View file

@ -161,6 +161,7 @@ public:
[[nodiscard]] virtual hand_index_t find_card_in_hand(const Card& card) const = 0; [[nodiscard]] virtual hand_index_t find_card_in_hand(const Card& card) const = 0;
[[nodiscard]] virtual bool is_trash(const Card& card) const = 0; [[nodiscard]] virtual bool is_trash(const Card& card) const = 0;
[[nodiscard]] virtual bool is_playable(const Card& card) const = 0; [[nodiscard]] virtual bool is_playable(const Card& card) const = 0;
[[nodiscard]] virtual size_t draw_pile_size() const = 0;
[[nodiscard]] virtual std::uint64_t enumerated_states() const = 0; [[nodiscard]] virtual std::uint64_t enumerated_states() const = 0;
[[nodiscard]] virtual std::unordered_map<unsigned long, double> visited_states() const = 0; [[nodiscard]] virtual std::unordered_map<unsigned long, double> visited_states() const = 0;
@ -194,6 +195,7 @@ public:
[[nodiscard]] hand_index_t find_card_in_hand(const Card& card) const final; [[nodiscard]] hand_index_t find_card_in_hand(const Card& card) const final;
[[nodiscard]] bool is_trash(const Card& card) const final; [[nodiscard]] bool is_trash(const Card& card) const final;
[[nodiscard]] bool is_playable(const Card& card) const final; [[nodiscard]] bool is_playable(const Card& card) const final;
[[nodiscard]] size_t draw_pile_size() const final;
[[nodiscard]] std::uint64_t enumerated_states() const final; [[nodiscard]] std::uint64_t enumerated_states() const final;
[[nodiscard]] std::unordered_map<unsigned long, double> visited_states() const final; [[nodiscard]] std::unordered_map<unsigned long, double> visited_states() const final;

View file

@ -554,4 +554,9 @@ namespace Hanabi {
return _position_tablebase; return _position_tablebase;
} }
template<suit_t num_suits, player_t num_players, hand_index_t hand_size>
size_t HanabiState<num_suits, num_players, hand_size>::draw_pile_size() const {
return _weighted_draw_pile_size;
}
} // namespace Hanabi } // namespace Hanabi