diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 08a74ff8ac..a365889320 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -111,7 +111,7 @@ void Game::setup(String player_name) } player.hand.append(card); } - quick_sort(player.hand, hearts_card_less); + player.sort_hand(); auto card_position = player.first_card_position; for (auto& card : player.hand) { card->set_position(card_position); diff --git a/Userland/Games/Hearts/Player.h b/Userland/Games/Hearts/Player.h index 3688bcb626..11d33c5e53 100644 --- a/Userland/Games/Hearts/Player.h +++ b/Userland/Games/Hearts/Player.h @@ -30,6 +30,8 @@ public: size_t pick_last_card(); bool has_card_of_type(Card::Type type); + void sort_hand() { quick_sort(hand, hearts_card_less); } + Vector> hand; Vector> cards_taken; Gfx::IntPoint first_card_position;