Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            XPuzzleSaveInfo thisSave = cons !.Resolve <XPuzzleSaveInfo>();


            _thisBoard !.CreateControls(thisSave.SpaceList);
            return(this.RefreshBindingsAsync(_aggregator));
        }
示例#2
0
 public XPuzzleGameBoardClass(IGamePackageResolver container,
                              XPuzzleSaveInfo saveroot,
                              RandomGenerator random,
                              ISaveSinglePlayerClass saves,
                              IEventAggregator aggregator)
 {
     MainContainer = container;
     _games        = saveroot;
     _rs           = random;
     _thisSave     = saves;
     _aggregator   = aggregator;
     _games.SpaceList.SetContainer(container);
 }
示例#3
0
        public async Task NewGameAsync()
        {
            if (await _thisSave.CanOpenSavedSinglePlayerGameAsync() == false)
            {
                _games.SpaceList.ClearBoard();
                PreviousOpen = new Vector(3, 3);
                CustomBasicList <int> thisList = _rs.GenerateRandomList(8);
                _games.SpaceList.PopulateBoard(thisList);
            }
            else
            {
                _games = await _thisSave.RetrieveSinglePlayerGameAsync <XPuzzleSaveInfo>(); //hopefully this is not iffy.

                MainContainer !.ReplaceObject(_games);
            }
            await _aggregator.SendLoadAsync();

            await _thisSave.SaveSimpleSinglePlayerGameAsync(_games);
        }
 private async Task RestoreGameAsync()
 {
     _saveRoot = await _thisState.RetrieveSinglePlayerGameAsync <XPuzzleSaveInfo>();
 }
 public XPuzzleMainGameClass(ISaveSinglePlayerClass thisState, IEventAggregator aggregator)
 {
     _thisState = thisState;
     Aggregator = aggregator;
     _saveRoot  = new XPuzzleSaveInfo();
 }