Пример #1
0
        public TileRummyVMData(CommandContainer command, IGamePackageResolver resolver, TileShuffler shuffle)
        {
            TempSets             = new TempSetsObservable <EnumColorType, EnumColorType, TileInfo>(command, resolver);
            TempSets.HowManySets = 4;

            //it also means that if something else is needed, then its done via delgates.
            TempSets.SetClickedAsync += TempSets_SetClickedAsync;
            MainSets1 = new MainSets(command);
            MainSets1.SetClickedAsync += MainSets1_SetClickedAsync;
            //the main view model has to set the enable processes.
            PlayerHand1 = new TileHand(command);
            Pool1       = new PoolCP(command, resolver, shuffle);
        }
Пример #2
0
        public override Task FinishGetSavedAsync()
        {
            LoadControls();
            int x = SaveRoot !.SetList.Count; //the first time, actually load manually.

            x.Times(items =>
            {
                PhaseSet thisSet = new PhaseSet(_gameContainer !);
                _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);
            return(base.FinishGetSavedAsync());
        }