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

Hearts: Prefer to pass high value cards

Previously we'd prefer to pass high points cards. Instead we should
prefer to pass high value cards first.
This commit is contained in:
Gunnar Beutner 2021-06-01 00:45:26 +02:00 committed by Andreas Kling
parent 8b9da08d5a
commit 63d3beb78c
2 changed files with 19 additions and 11 deletions

View file

@ -42,7 +42,7 @@ public:
Optional<size_t> pick_specific_card(Card::Type type, CardValue value);
size_t pick_last_card();
bool has_card_of_type(Card::Type type);
Vector<CardWithIndex> hand_sorted_by_points_and_value() const;
Vector<CardWithIndex> hand_sorted_by_fn(bool (*)(CardWithIndex&, CardWithIndex&)) const;
void sort_hand() { quick_sort(hand, hearts_card_less); }
void remove_cards(NonnullRefPtrVector<Card> const& cards);