public PyramidSolitaireMainGameClass(ISaveSinglePlayerClass thisState, IEventAggregator aggregator, IGamePackageResolver container ) { _thisState = thisState; Aggregator = aggregator; SaveRoot = container.ReplaceObject <PyramidSolitaireSaveInfo>(); //can't create new one. because if doing that, then anything that needs it won't have it. SaveRoot.Load(Aggregator); }
public override async Task OpenSavedGameAsync() { DeckList.OrderedObjects(); //i think SaveRoot = await _thisState.RetrieveSinglePlayerGameAsync <HeapSolitaireSaveInfo>(); if (SaveRoot.DeckList.Count > 0) { var newList = SaveRoot.DeckList.GetNewObjectListFromDeckList(DeckList); DeckPile !.OriginalList(newList); //not sure if we need this or not (?) //DeckPile.Visible = true; } //anything else that is needed to open the saved game will be here. _model !.Main1.PileList !.ReplaceRange(SaveRoot.MainPiles !); //iffy. _model.Main1.RefreshInfo(); SaveRoot.Load(Aggregator); _model.Waste1 !.PileList !.ReplaceRange(SaveRoot.WasteData !); //also iffy. }