From 548bb371ff9c7e98178c2f061b79fd15c6980c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Tue, 8 Aug 2023 00:31:16 +0200 Subject: [PATCH] add missing draw pile function --- game_state.h | 2 ++ game_state.hpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/game_state.h b/game_state.h index 350924c..3c65771 100644 --- a/game_state.h +++ b/game_state.h @@ -161,6 +161,7 @@ public: [[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_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::unordered_map visited_states() const = 0; @@ -194,6 +195,7 @@ public: [[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_playable(const Card& card) const final; + [[nodiscard]] size_t draw_pile_size() const final; [[nodiscard]] std::uint64_t enumerated_states() const final; [[nodiscard]] std::unordered_map visited_states() const final; diff --git a/game_state.hpp b/game_state.hpp index 5379a6d..1ac87db 100644 --- a/game_state.hpp +++ b/game_state.hpp @@ -554,4 +554,9 @@ namespace Hanabi { return _position_tablebase; } + template + size_t HanabiState::draw_pile_size() const { + return _weighted_draw_pile_size; + } + } // namespace Hanabi \ No newline at end of file