1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 17:40:24 +08:00
Files
osu-lazer/osu.Game.Tests/Visual
T
maarvin 7b0e5ecc13 Code quality improvements for child/draw order handling in HandOfCards (#37423)
Attempt at adressing the points made in
https://github.com/ppy/osu/pull/37419#issuecomment-4279123323

- `CardContainer` is now being sorted immediately instead of only doing
it once per frame. Given that its only ever gonna have a handful of
children there wasn't really a need to optimize that that in the first
place.
- `HandOfCards.Cards` now exposes `cardLookup.Values` as an
`IEnumerable` instead of exposing the card container's children
directly.
- `HandOfCard` now exposes `GetCardsInDisplayOrder` which returns a copy
of all cards in display order. Since it's making a copy I made sure this
isn't called on any hot code paths.
- `HandOfCard.Clear` previously didn't clear the `cardLookup`
dictionary. Didn't cause any issues since we're not re-adding cards to
the hand anywhere but not good regardless.
Switched to looping over all cards and calling `RemoveCard` to make sure
changes to the removal logic can't get overlooked there again.

---------

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
7b0e5ecc13 · 2026-04-21 22:54:36 +09:00
History
..
2025-05-21 19:01:47 +03:00
2026-03-19 00:05:52 +09:00