mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-29 19:11:51 +00:00
We're getting into the less than 0.1s realm of low hanging fruits now. Decks of cards were initializing thousands of cards at once, not unlike [paper bins](https://github.com/tgstation/tgstation/pull/69586) or [circuit components](https://github.com/tgstation/tgstation/pull/69664). Cards are more complicated than paper bins since we can't just keep a count, and managing individual card object lifetimes is significantly more complicated than incrementing/decrementing a number. Thus, the logic here is slightly different. Decks now have an `initial_cards` variable which can take card names (which is most implementers), and for special decks, can specify an interface that is basically a lazy function for creating a card atom. When anything needs any real card atom, we just generate them all. The runtime cost of this is extremely small, and affects neither dev cycles (the motivation for the change) or ongoing rounds.