1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 16:37:47 +00:00

Hearts: Let the AI prefer lead cards for which other cards are in play

When picking a lead card the AI should avoid playing cards where it
knows that no other player has a lower value card of the same type.
This commit is contained in:
Gunnar Beutner 2021-05-23 14:49:58 +02:00 committed by Andreas Kling
parent 647d0f9f8a
commit 2dfced2501
3 changed files with 19 additions and 5 deletions

View file

@ -21,7 +21,7 @@ public:
{
}
size_t pick_lead_card(Function<bool(Card&)>, Function<bool(Card&)>);
size_t pick_lead_card(Function<bool(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);