1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 21:27:36 +00:00

Hearts: Let the AI pick better lead cards

Instead of picking the card with the lowest value we should pick the
card with the highest value for which we know no lower value card is
in play anymore and that someone else still has an even higher value
card.
This commit is contained in:
Gunnar Beutner 2021-05-22 11:21:56 +02:00 committed by Linus Groh
parent c2a4b581fe
commit 1ae18c1228
4 changed files with 64 additions and 18 deletions

View file

@ -45,6 +45,8 @@ private:
Player& current_player();
bool game_ended() const { return m_trick_number == 13; }
bool is_winner(Player& player);
bool other_player_has_lower_value_card(Player& player, Card& card);
bool other_player_has_higher_value_card(Player& player, Card& card);
void start_animation(NonnullRefPtrVector<Card> cards, Gfx::IntPoint const& end, Function<void()> did_finish_callback, int initial_delay_ms, int steps = 30);
void stop_animation();