Esempio n. 1
0
 public CrazyEightsVMData(IEventAggregator aggregator, CommandContainer command)
 {
     Deck1       = new DeckObservablePile <RegularSimpleCard>(aggregator, command);
     Pile1       = new PileObservable <RegularSimpleCard>(aggregator, command);
     PlayerHand1 = new HandObservable <RegularSimpleCard>(command);
     SuitChooser = new SimpleEnumPickerVM <EnumSuitList, DeckPieceCP>(command, new SuitListChooser());
     SuitChooser.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
 }
 public UnoVMData(IEventAggregator aggregator, CommandContainer command)
 {
     Deck1            = new DeckObservablePile <UnoCardInformation>(aggregator, command);
     Pile1            = new PileObservable <UnoCardInformation>(aggregator, command);
     PlayerHand1      = new HandObservable <UnoCardInformation>(command);
     PlayerHand1.Text = "Your Cards";
     ColorPicker      = new SimpleEnumPickerVM <EnumColorTypes, CheckerChoiceCP <EnumColorTypes> >(command, new ColorListChooser <EnumColorTypes>());
     Stops            = new CustomStopWatchCP();
     Stops.MaxTime    = 3000;
     ColorPicker.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
 }
Esempio n. 3
0
 public LifeBoardGameVMData(CommandContainer command, IGamePackageResolver resolver, IEventAggregator aggregator)
 {
     HandList      = new HandObservable <LifeBaseCard>(command);
     GenderChooser = new SimpleEnumPickerVM <EnumGender, CirclePieceCP <EnumGender> >(command, new ColorListChooser <EnumGender>());         //hopefully still works.
     GenderChooser.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
     PlayerPicker                    = new ListViewPicker(command, resolver);
     PlayerPicker.IndexMethod        = EnumIndexMethod.OneBased;
     PlayerPicker.ItemSelectedAsync += PlayerPicker_ItemSelectedAsync;
     SinglePile = new PileObservable <LifeBaseCard>(aggregator, command);
     SinglePile.SendAlwaysEnable(this);             //hopefuly this simple.
     SinglePile.Text         = "Card";
     SinglePile.CurrentOnly  = true;
     HandList.Text           = "None";
     HandList.IgnoreMaxRules = true;
 }
 public PickelCardGameVMData(IEventAggregator aggregator,
                             CommandContainer command,
                             BasicTrickAreaObservable <EnumSuitList, PickelCardGameCardInformation> trickArea1,
                             IGamePackageResolver resolver
                             )
 {
     Deck1                    = new DeckObservablePile <PickelCardGameCardInformation>(aggregator, command);
     Pile1                    = new PileObservable <PickelCardGameCardInformation>(aggregator, command);
     PlayerHand1              = new HandObservable <PickelCardGameCardInformation>(command);
     PlayerHand1.Text         = "Your Cards";
     TrickArea1               = trickArea1;
     Bid1                     = new NumberPicker(command, resolver);
     Suit1                    = new SimpleEnumPickerVM <EnumSuitList, DeckPieceCP>(command, new SuitListChooser());
     Suit1.AutoSelectCategory = EnumAutoSelectCategory.AutoSelect;
     //rethink on the next part.
 }
Esempio n. 5
0
 public RookVMData(IEventAggregator aggregator,
                   CommandContainer command,
                   RookTrickAreaCP trickArea1,
                   IGamePackageResolver resolver,
                   RookGameContainer gameContainer
                   )
 {
     Deck1          = new DeckObservablePile <RookCardInformation>(aggregator, command);
     Pile1          = new PileObservable <RookCardInformation>(aggregator, command);
     PlayerHand1    = new HandObservable <RookCardInformation>(command);
     TrickArea1     = trickArea1;
     _gameContainer = gameContainer;
     Bid1           = new NumberPicker(command, resolver);
     Color1         = new SimpleEnumPickerVM <EnumColorTypes, CheckerChoiceCP <EnumColorTypes> >(command, new ColorListChooser <EnumColorTypes>());
     Dummy1         = new DummyHandCP(command);
     Bid1.ChangedNumberValueAsync += Bid1_ChangedNumberValueAsync;
     Color1.AutoSelectCategory     = EnumAutoSelectCategory.AutoEvent;
     Color1.ItemClickedAsync      += Color1_ItemClickedAsync;
 }
Esempio n. 6
0
 public RageCardGameVMData(IEventAggregator aggregator,
                           CommandContainer command,
                           SpecificTrickAreaObservable trickArea1,
                           IGamePackageResolver resolver,
                           RageCardGameGameContainer gameContainer
                           )
 {
     Deck1                     = new DeckObservablePile <RageCardGameCardInformation>(aggregator, command);
     Pile1                     = new PileObservable <RageCardGameCardInformation>(aggregator, command);
     PlayerHand1               = new HandObservable <RageCardGameCardInformation>(command);
     PlayerHand1.Maximum       = 11;
     TrickArea1                = trickArea1;
     _gameContainer            = gameContainer;
     Color1                    = new SimpleEnumPickerVM <EnumColor, CheckerChoiceCP <EnumColor> >(command, new ColorListChooser <EnumColor>());
     Color1.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
     Color1.ItemClickedAsync  += Color1_ItemClickedAsync;
     Bid1 = new NumberPicker(command, resolver);
     Bid1.ChangedNumberValueAsync += Bid1_ChangedNumberValueAsync;
 }
 public SkuckCardGameVMData(IEventAggregator aggregator,
                            CommandContainer command,
                            BasicTrickAreaObservable <EnumSuitList, SkuckCardGameCardInformation> trickArea1,
                            IGamePackageResolver resolver,
                            SkuckCardGameGameContainer gameContainer
                            )
 {
     Deck1          = new DeckObservablePile <SkuckCardGameCardInformation>(aggregator, command);
     Pile1          = new PileObservable <SkuckCardGameCardInformation>(aggregator, command);
     PlayerHand1    = new HandObservable <SkuckCardGameCardInformation>(command);
     TrickArea1     = trickArea1;
     _gameContainer = gameContainer;
     Bid1           = new NumberPicker(command, resolver);
     Suit1          = new SimpleEnumPickerVM <EnumSuitList, DeckPieceCP>(command, new SuitListChooser());
     //iffy part is the trickarea visible.
     Suit1.AutoSelectCategory      = EnumAutoSelectCategory.AutoSelect;
     Bid1.ChangedNumberValueAsync += Bid1_ChangedNumberValueAsync;
     Suit1.ItemSelectionChanged   += Suit1_ItemSelectionChanged;
     Bid1.LoadNormalNumberRangeValues(1, 26);
 }
 public void LoadLists(SimpleEnumPickerVM <E, GC> mod)
 {
     _thisMod  = mod;
     _itemList = mod.ItemList;
     Margin    = new Thickness(10, 10, 10, 10);
     _itemList.CollectionChanged += ItemList_CollectionChanged;
     //_thisMod.PropertyChanged += ThisMod_PropertyChanged;
     //if (_thisMod.Visible == true)
     //    Visibility = Visibility.Visible; //try this way too.  because on games like board games, it can be visible at this point.
     _thisGrid = new Grid();
     if (Columns > 1 || Rows > 1)
     {
         GraphicsHeight = 100;
         GraphicsWidth  = 100;
     }
     _thisGrid = new Grid();
     AddAutoColumns(_thisGrid, 15);
     AddAutoRows(_thisGrid, 15);
     PopulateList();
     Content = _thisGrid;
 }
        public MastermindMainViewModel(IEventAggregator aggregator, CommandContainer commandContainer,
                                       IGamePackageResolver resolver,
                                       LevelClass level
                                       )
        {
            _aggregator = aggregator;
            //looks like can't just ask for the mainboard.  because if you do, then when i change the global class, they have the old one (wrong)
            LevelChosen      = level.LevelChosen;
            CommandContainer = commandContainer;
            _global          = resolver.ReplaceObject <GlobalClass>(); //looks like global has to be replaced before game.  otherwise, reference is broken.
            CustomColorClass colorClass = new CustomColorClass(_global);

            //hopefully won't cause another problem (?)
            _mainGame = resolver.ReplaceObject <MastermindMainGameClass>(); //hopefully this works.  means you have to really rethink.



            MainBoard = resolver.Resolve <GameBoardViewModel>(); //by this time, it will have the proper global class.
            //ActiveViewModel = MainBoard;
            Color1 = new SimpleEnumPickerVM <EnumColorPossibilities, CirclePieceCP <EnumColorPossibilities> >(commandContainer, colorClass);
            Color1.AutoSelectCategory = EnumAutoSelectCategory.AutoEvent;
            Color1.IsEnabled          = true;
            Color1.ItemClickedAsync  += Color1_ItemClickedAsync;
        }
Esempio n. 10
0
 public void LoadLists(SimpleEnumPickerVM <E, GC> mod)
 {
     _thisMod  = mod;
     _itemList = mod.ItemList;
     Margin    = new Thickness(5, 5, 5, 5);
     _itemList.CollectionChanged += ItemList_CollectionChanged;
     _thisGrid = new Grid();
     _thisGrid.HorizontalOptions = LayoutOptions.Start;
     _thisGrid.VerticalOptions   = LayoutOptions.Start;
     HorizontalOptions           = LayoutOptions.Start;
     VerticalOptions             = LayoutOptions.Start;
     if (GraphicsHeight == 0 || GraphicsWidth == 0)
     {
         IEnumPickerSize picks = Resolve <IEnumPickerSize>();
         if (Columns > 1 || Rows > 1)
         {
             GraphicsHeight = picks.SmallGraphicsWidthHeight;
             GraphicsWidth  = picks.SmallGraphicsWidthHeight;
         }
         else
         {
             GraphicsHeight = picks.NormalGraphicsWidthHeight;
             GraphicsWidth  = picks.NormalGraphicsWidthHeight;
         }
     }
     _thisGrid = new Grid();
     if (Spacing > -1)
     {
         _thisGrid.RowSpacing    = Spacing;
         _thisGrid.ColumnSpacing = Spacing;
     }
     AddAutoColumns(_thisGrid, 15);
     AddAutoRows(_thisGrid, 15);
     PopulateList();
     Content = _thisGrid;
 }