Пример #1
0
        public override Task FinishGetSavedAsync()
        {
            _model !.MainSets !.ClearBoard();
            LoadControls();
            int x = SaveRoot !.SetList.Count; //the first time, actually load manually.

            x.Times(items =>
            {
                DummySet thisSet = new DummySet(_command);
                _model.MainSets.CreateNewSet(thisSet);
            });
            PlayerList !.ForEach(thisPlayer =>
            {
                if (thisPlayer.AdditionalCards.Count > 0)
                {
                    thisPlayer.MainHandList.AddRange(thisPlayer.AdditionalCards); //later sorts anyways.
                    thisPlayer.AdditionalCards.Clear();                           //i think.
                }
            });
            SingleInfo = PlayerList.GetSelf(); //hopefully won't cause problems.
            SortCards();                       //has to be this way this time.
            _model.MainSets.LoadSets(SaveRoot.SetList);
            SaveRoot.LoadMod(_model);
            return(base.FinishGetSavedAsync());
        }
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     SaveRoot.LoadMod(_model);
     //anything else needed is here.
     return(base.FinishGetSavedAsync());
 }
 private void HookMod()
 {
     SaveRoot.LoadMod(_model);
     if (SaveRoot.DidDraw)
     {
         _model.CardDetails = SaveRoot.CurrentCard !.Details;
     }
 }
Пример #4
0
 public ClockSolitaireMainGameClass(ISaveSinglePlayerClass thisState,
                                    IEventAggregator aggregator,
                                    IGamePackageResolver container
                                    )
 {
     _thisState = thisState;
     Aggregator = aggregator;
     SaveRoot   = container.ReplaceObject <ClockSolitaireSaveInfo>(); //can't create new one.  because if doing that, then anything that needs it won't have it.
     SaveRoot.LoadMod(aggregator);
 }
Пример #5
0
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     AfterRestoreDice();
     BoardGameSaved();         //i think.
     SaveRoot.LoadMod(_model); //we usually need this.
     _gameBoard.LoadSavedGame();
     //anything else needed is here.
     return(Task.CompletedTask);
 }
 private void LoadControls()
 {
     if (IsLoaded == true)
     {
         return;
     }
     LoadMod();
     SaveRoot.LoadMod(_model);
     IsLoaded = true; //i think needs to be here.
 }
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     BoardGameSaved(); //i think.
     SaveRoot.LoadMod(_model);
     if (PlayerList.DidChooseColors() && SaveRoot.GameStatus != EnumWhatStatus.NeedChooseGender)
     {
         //if choosing gender, rethink.
         _gameBoard.LoadSavedGame();
         PlayerList !.ForEach(thisPlayer =>
         {
             var thisList = thisPlayer.Hand.ToRegularDeckDict();
             thisPlayer.Hand.Clear();
             thisList.ForEach(tempCard =>
             {
                 if (tempCard.Deck <= 9)
                 {
                     thisPlayer.Hand.Add(CardsModule.GetCareerCard(tempCard.Deck));
                 }
                 else if (tempCard.Deck <= 18)
                 {
                     thisPlayer.Hand.Add(CardsModule.GetHouseCard(tempCard.Deck));
                 }
                 else if (tempCard.Deck <= 27)
                 {
                     thisPlayer.Hand.Add(CardsModule.GetSalaryCard(tempCard.Deck));
                 }
                 else if (tempCard.Deck <= 36)
                 {
                     thisPlayer.Hand.Add(CardsModule.GetStockCard(tempCard.Deck));
                 }
                 else
                 {
                     throw new BasicBlankException("Must be between 1 and 36");
                 }
             });
         });
         if (SaveRoot.ChangePosition > 0)
         {
             _gameContainer.SpinnerPosition = SaveRoot.ChangePosition;
             _gameContainer.SpinnerRepaint();
         }
         if (SaveRoot.GameStatus == EnumWhatStatus.NeedToEndTurn)
         {
             SingleInfo = PlayerList.GetWhoPlayer();
             if (SingleInfo.Position > 0 && SingleInfo.LastMove == EnumFinal.None)
             {
                 _model.GameDetails = _boardProcesses.GetSpaceDetails(SingleInfo.Position);
             }
         }
     }
     //anything else needed is here.
     return(Task.CompletedTask);
 }
Пример #8
0
 public override Task FinishGetSavedAsync()
 {
     if (SaveRoot !.GameStatus != EnumStatusType.Beginning)
     {
         throw new BasicBlankException("No autoresume.  Therefore, had to be beginning");
     }
     LoadControls();
     SaveRoot.LoadMod(_model);
     //anything else needed is here.
     return(base.FinishGetSavedAsync());
 }
Пример #9
0
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     AfterRestoreDice();
     BoardGameSaved(); //i think.
     _model.Cup !.ShowDiceListAlways = true;
     _model.Cup.Visible     = true;
     _model.Cup.CanShowDice = true;
     SaveRoot.LoadMod(_model); //we usually need this.
     //anything else needed is here.
     return(Task.CompletedTask);
 }
 public override async Task SetUpGameAsync(bool isBeginning)
 {
     LoadControls();
     if (FinishUpAsync == null)
     {
         throw new BasicBlankException("The loader never set the finish up code.  Rethink");
     }
     SaveRoot !.ImmediatelyStartTurn = true; //most of the time, needs to immediately start turn.  if i am wrong, rethink.
     SaveRoot.LoadMod(_model);
     //hopefully the erasing of colors is already handled.
     await FinishUpAsync(isBeginning);
 }
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     AfterRestoreDice();
     _gameBoard.LoadSavedGame();
     BoardGameSaved();         //i think.
     SaveRoot.LoadMod(_model); //we usually need this.
     //can't send turn because view model not created yet at this point.
     _model.Cup !.CanShowDice = SaveRoot.DiceNumber > 0;
     //anything else needed is here.
     return(Task.CompletedTask);
 }
 //maybe no need anymore for the populatesaveroot because i am using same address.
 private void LoadGame()
 {
     LoadMod();
     PlayerList.ForEach(player =>
     {
         if (player.RowList.Count == 0)
         {
             _scoreContainer.RowList = player.RowList.ToCustomBasicList(); //try this way.  hopefully will allow cloning back later.
             _scoreLogic.LoadBoard();
             player.RowList = _scoreContainer.RowList.ToCustomBasicList();
         }
     });
     SaveRoot.LoadMod(_model);
 }
Пример #13
0
        public override async Task OpenSavedGameAsync()
        {
            DeckList.OrderedObjects(); //i think
            SaveRoot = await _thisState.RetrieveSinglePlayerGameAsync <ClockSolitaireSaveInfo>();

            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;
            }
            _clock1 !.LoadSavedClocks(SaveRoot.SavedClocks);
            SaveRoot.LoadMod(Aggregator);
        }
        protected override Task LastPartOfSetUpBeforeBindingsAsync() //try here instead.
        {
            var tempCard = _model !.Pile1 !.GetCardInfo();

            SaveRoot !.CurrentNumber = tempCard.Value;
            if (tempCard.DisplaySuit == EnumSuitList.None)
            {
                SaveRoot.CurrentSuit = tempCard.Suit;
            }
            else
            {
                SaveRoot.CurrentSuit = tempCard.DisplaySuit;
            }
            SaveRoot.CurrentCard = tempCard.Deck; //i think
            SaveRoot.LoadMod(_model);
            return(Task.CompletedTask);
        }
Пример #15
0
 protected override Task StartSetUpAsync(bool isBeginning)
 {
     LoadControls();
     _model.Beginnings1.ObjectList.Clear(); //try this way.
     _model.GolfHand1.ObjectList.Clear();   //try this too.
     PlayerList !.ForEach(thisPlayer =>
     {
         thisPlayer.FinishedChoosing = false;
         thisPlayer.Knocked          = false;
         thisPlayer.FirstChanged     = false;
         thisPlayer.SecondChanged    = false;
     });
     SaveRoot !.Round++;                             //i think.
     SaveRoot.GameStatus = EnumStatusType.Beginning; //i think.
     SaveRoot.LoadMod(_model);                       //just in case
     return(base.StartSetUpAsync(isBeginning));
 }
 public override Task FinishGetSavedAsync()
 {
     LoadControls();
     AfterRestoreDice();
     BoardGameSaved(); //i think.
     if (SaveRoot.GameStatus == EnumGameStatusList.RollDice)
     {
         _model.Cup !.CanShowDice = false;
     }
     else
     {
         _model.Cup !.CanShowDice = true;
     }
     SaveRoot.LoadMod(_model); //we usually need this.
     //anything else needed is here.
     return(Task.CompletedTask);
 }
Пример #17
0
 protected void LoadMod()
 {
     SaveRoot.LoadMod(_model); //hopefully this simple (?)
 }