1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibCards: Make find_card_stack_to_drop_on() non-const

This function returns a card stack that we might want to drop a card on,
so intuitively it should be a mutating function.
This commit is contained in:
Andreas Kling 2023-02-19 23:30:58 +01:00
parent df07416171
commit 08a90455ac
2 changed files with 3 additions and 3 deletions

View file

@ -59,14 +59,14 @@ ErrorOr<void> CardGame::pick_up_cards_from_stack(Cards::CardStack& stack, Gfx::I
return {};
}
RefPtr<CardStack> CardGame::find_stack_to_drop_on(CardStack::MovementRule movement_rule) const
RefPtr<CardStack> CardGame::find_stack_to_drop_on(CardStack::MovementRule movement_rule)
{
auto bounds_to_check = moving_cards_bounds();
RefPtr<CardStack> closest_stack;
float closest_distance = FLT_MAX;
for (auto const& stack : stacks()) {
for (auto& stack : stacks()) {
if (stack == moving_cards_source_stack())
continue;