Esempio n. 1
0
        public PokerMainViewModel(IEventAggregator aggregator,
                                  CommandContainer commandContainer,
                                  IGamePackageResolver resolver
                                  )
        {
            GlobalClass.PokerList.Clear(); //can't be brand new  that could cause the connection to break too.
            _aggregator      = aggregator; //this time no new game.  just close out when you are done now.
            Round            = 1;
            CommandContainer = commandContainer;
            CommandContainer.ExecutingChanged += CommandContainer_ExecutingChanged; //hopefully no problem (?)
            DeckPile = resolver.ReplaceObject <DeckObservablePile <PokerCardInfo> >();
            DeckPile.DeckClickedAsync += DeckPile_DeckClickedAsync;
            DeckPile.NeverAutoDisable  = true;
            DeckPile.SendEnableProcesses(this, () =>
            {
                return(!IsRoundOver);
            });

            Bet1 = new NumberPicker(commandContainer, resolver);
            Bet1.SendEnableProcesses(this, () =>
            {
                return(!BetPlaced);
            });
            Bet1.LoadNumberList(new CustomBasicList <int>()
            {
                5, 10, 25
            });
            Bet1.SelectNumberValue(5); //something else has to set to large (?)
            Bet1.ChangedNumberValueAsync += Bet1_ChangedNumberValueAsync;

            _mainGame = resolver.ReplaceObject <PokerMainGameClass>(); //hopefully this works.  means you have to really rethink.
        }
Esempio n. 2
0
 public FroggiesOpeningViewModel(CommandContainer container,
                                 IGamePackageResolver resolver,
                                 LevelClass global,
                                 BasicData data
                                 )
 {
     _global          = global;
     CommandContainer = container;
     NumberOfFrogs    = _global.NumberOfFrogs;
     LevelPicker      = new NumberPicker(container, resolver);
     if (data.IsXamarinForms == false)
     {
         LevelPicker.LoadNormalNumberRangeValues(3, 70);
     }
     else
     {
         LevelPicker.LoadNormalNumberRangeValues(3, 40); //maybe can load more.  well see.
     }
     LevelPicker.SelectNumberValue(NumberOfFrogs);
     LevelPicker.ChangedNumberValueAsync += LevelPicker_ChangedNumberValueAsync;
 }