[DeckLoader] Make save/load methods static (#6476)

* const

* [DeckLoader] make methods static

* use static methods

* add docs

* add docs
This commit is contained in:
RickyRister 2026-01-16 10:20:36 -08:00 committed by GitHub
parent c7c7bf550a
commit d579c82cb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 209 additions and 166 deletions

View file

@ -78,10 +78,9 @@ void HomeWidget::initializeBackgroundFromSource()
void HomeWidget::loadBackgroundSourceDeck()
{
DeckLoader deckLoader = DeckLoader(this);
deckLoader.loadFromFile(SettingsCache::instance().getDeckPath() + "background.cod", DeckFileFormat::Cockatrice,
false);
backgroundSourceDeck = deckLoader.getDeck().deckList;
std::optional<LoadedDeck> deckOpt = DeckLoader::loadFromFile(
SettingsCache::instance().getDeckPath() + "background.cod", DeckFileFormat::Cockatrice, false);
backgroundSourceDeck = deckOpt.has_value() ? deckOpt.value().deckList : DeckList();
}
void HomeWidget::updateRandomCard()