[DeckLoader] Refactor to make some methods static (#6336)

* Make forEachCard const

* Make some DeckLoader methods static

* Update usages

* Update method param documentation in deck_loader.cpp

---------

Co-authored-by: BruebachL <44814898+BruebachL@users.noreply.github.com>
This commit is contained in:
RickyRister 2025-11-17 03:49:45 -08:00 committed by GitHub
parent a8ee0d7648
commit 16392c28c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 80 additions and 65 deletions

View file

@ -722,7 +722,7 @@ void DeckList::refreshDeckHash()
/**
* Calls a given function on each card in the deck.
*/
void DeckList::forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func)
void DeckList::forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func) const
{
// Support for this is only possible if the internal structure
// doesn't get more complicated.

View file

@ -315,7 +315,7 @@ public:
*
* @param func Function taking (zone node, card node).
*/
void forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func);
void forEachCard(const std::function<void(InnerDecklistNode *, DecklistCardNode *)> &func) const;
};
#endif