1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:57:45 +00:00

Hearts: Pick better lead cards

Previously the AI would prefer playing a lead card for which no other
player had a card with a higher value even though it also had a card
for which a higher value card was still in play.
This commit is contained in:
Gunnar Beutner 2021-05-31 23:56:13 +02:00 committed by Andreas Kling
parent 40ddb734ee
commit 38f8a6aabb
3 changed files with 4 additions and 18 deletions

View file

@ -34,7 +34,7 @@ public:
}
NonnullRefPtrVector<Card> pick_cards_to_pass(PassingDirection);
size_t pick_lead_card(Function<bool(Card&)>, Function<bool(Card&)>, Function<bool(Card&)>);
size_t pick_lead_card(Function<bool(Card&)>, Function<bool(Card&)>);
Optional<size_t> pick_low_points_high_value_card(Optional<Card::Type> type = {});
Optional<size_t> pick_lower_value_card(Card& other_card);
Optional<size_t> pick_slightly_higher_value_card(Card& other_card);