1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

Hearts: Move hand sorting functionality into a method

This commit is contained in:
Gunnar Beutner 2021-05-24 10:27:05 +02:00 committed by Andreas Kling
parent 6da481205b
commit 4e3a1f2da9
2 changed files with 3 additions and 1 deletions

View file

@ -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);