public ThreeLetterFunMainGameClass(IGamePackageResolver resolver,
                                    IEventAggregator aggregator,
                                    BasicData basic,
                                    TestOptions test,
                                    ThreeLetterFunVMData model,
                                    IMultiplayerSaveState state,
                                    IAsyncDelayer delay,
                                    CommandContainer command,
                                    GameBoard gameboard,
                                    GlobalHelpers global,
                                    IListShuffler <ThreeLetterFunCardData> deck,
                                    BasicGameContainer <ThreeLetterFunPlayerItem, ThreeLetterFunSaveInfo> gameContainer
                                    ) : base(resolver, aggregator, basic, test, model, state, delay, command, gameContainer)
 {
     _test              = test;
     _model             = model;
     _command           = command;
     _gameboard         = gameboard;
     _global            = global;
     _deck              = deck;
     _gameboard.SetSelf = (() =>
     {
         SingleInfo = PlayerList.GetSelf();
     });
     _gameboard.SingleInfo = (() => SingleInfo !);
     _gameboard.SaveRoot   = (() => SaveRoot);
 }
Esempio n. 2
0
 public GlobalHelpers(BasicData basicData, ThreeLetterFunVMData model, CommandContainer command)
 {
     _basicData = basicData;
     _model     = model;
     _command   = command;
     LoadItems();
     PopulateWords(); //risk doing here.  hopefully i won't regret this.
 }
        private readonly ThreeLetterFunCardData _tempCard; //not sure.

        public ThreeLetterFunMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      ThreeLetterFunMainGameClass mainGame,
                                      ThreeLetterFunVMData model,
                                      GameBoard gameBoard
                                      )
        {
            _aggregator = aggregator;
            _mainGame   = mainGame;
            _model      = model;
            _gameBoard  = gameBoard;
            model.NewUI = this;
            _aggregator.Subscribe(this);
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(ThreeLetterFunMainViewModel.RestoreScreen));
            }

            _tempCard         = new ThreeLetterFunCardData();
            _tempCard.Visible = false;
            _currentCard      = new CardGraphicsXF();
            _currentCard.SendSize(ThreeLetterFunCardGraphicsCP.TagUsed, _tempCard); //i think.

            var winLabel = GetDefaultLabel();

            winLabel.SetBinding(Label.TextProperty, new Binding(nameof(ThreeLetterFunMainViewModel.PlayerWon)));
            _score = new ScoreBoardXF();
            _score.AddColumn("Cards Won", true, nameof(ThreeLetterFunPlayerItem.CardsWon));
            StackLayout otherStack = new StackLayout();

            otherStack.Orientation = StackOrientation.Horizontal;
            mainStack.Children.Add(_currentCard);
            mainStack.Children.Add(winLabel);
            mainStack.Children.Add(_gameBoard1);
            mainStack.Children.Add(_tileBoard1);
            var thisBut = GetGamingButton("Play", nameof(ThreeLetterFunMainViewModel.PlayAsync));

            otherStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Give Up", nameof(ThreeLetterFunMainViewModel.GiveUpAsync));
            otherStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Take Back", nameof(ThreeLetterFunMainViewModel.TakeBack));
            otherStack.Children.Add(thisBut);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(_score);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }



            Content = mainStack;
        }
Esempio n. 4
0
 public void Init(ThreeLetterFunVMData model)
 {
     _tempMod  = model.TileBoard1;
     _tileList = _tempMod !.HandList;
     _tileList.CollectionChanged += TileList_CollectionChanged;
     _thisStack             = new StackLayout();
     _thisStack.Orientation = StackOrientation.Horizontal;
     Content = _thisStack;
     PopulateControls();
 }
Esempio n. 5
0
 public void Init(ThreeLetterFunVMData model)
 {
     //ThreeLetterFunViewModel thisMod = Resolve<ThreeLetterFunViewModel>();
     _tempMod  = model.TileBoard1;
     _tileList = _tempMod !.HandList;
     _tileList.CollectionChanged += TileList_CollectionChanged;
     _thisStack             = new StackPanel();
     _thisStack.Orientation = Orientation.Horizontal;
     Content = _thisStack;
     PopulateControls();
 }
 public BasicTileShuffler(GlobalHelpers global,
                          IListShuffler <ThreeLetterFunCardData> deck,
                          GameBoard board,
                          ThreeLetterFunVMData model,
                          IEventAggregator aggregator
                          )
 {
     _global     = global;
     _deck       = deck;
     _board      = board;
     _model      = model;
     _aggregator = aggregator;
 }
Esempio n. 7
0
 public GameBoard(CommandContainer container,
                  IAsyncDelayer delay,
                  GlobalHelpers global,
                  ThreeLetterFunVMData model,
                  BasicData basicData,
                  TestOptions test,
                  IListShuffler <ThreeLetterFunCardData> deck
                  ) : base(container)
 {
     _delay     = delay;
     _global    = global;
     _model     = model;
     _basicData = basicData;
     _test      = test;
     _deck      = deck;
     HasFrame   = false;
     Visible    = true;
     IsEnabled  = false;
 }
Esempio n. 8
0
        private readonly ThreeLetterFunCardData _tempCard; //not sure.
        public ThreeLetterFunMainView(IEventAggregator aggregator,
                                      TestOptions test,
                                      ThreeLetterFunMainGameClass mainGame,
                                      ThreeLetterFunVMData model,
                                      GameBoard gameBoard
                                      )
        {
            _aggregator = aggregator;
            _mainGame   = mainGame;
            _model      = model;
            _gameBoard  = gameBoard;
            model.NewUI = this;
            _aggregator.Subscribe(this);
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer()
                {
                    Name = nameof(ThreeLetterFunMainViewModel.RestoreScreen)
                };
            }
            _tempCard         = new ThreeLetterFunCardData();
            _tempCard.Visible = false;
            _currentCard      = new CardGraphicsWPF();
            _currentCard.SendSize(ThreeLetterFunCardGraphicsCP.TagUsed, _tempCard); //i think.

            var winLabel = GetDefaultLabel();

            winLabel.SetBinding(TextBlock.TextProperty, new Binding(nameof(ThreeLetterFunMainViewModel.PlayerWon)));
            _score = new ScoreBoardWPF();
            _score.AddColumn("Cards Won", true, nameof(ThreeLetterFunPlayerItem.CardsWon));
            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            mainStack.Children.Add(_currentCard);
            mainStack.Children.Add(winLabel);
            mainStack.Children.Add(_gameBoard1);
            mainStack.Children.Add(_tileBoard1);
            var thisBut = GetGamingButton("Play", nameof(ThreeLetterFunMainViewModel.PlayAsync));

            otherStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Give Up", nameof(ThreeLetterFunMainViewModel.GiveUpAsync));
            otherStack.Children.Add(thisBut);
            thisBut = GetGamingButton("Take Back", nameof(ThreeLetterFunMainViewModel.TakeBack));
            otherStack.Children.Add(thisBut);
            mainStack.Children.Add(otherStack);
            mainStack.Children.Add(_score);

            if (restoreP != null)
            {
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }



            GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually.

            if (_mainGame.BasicData.MultiPlayer)
            {
                _score.LoadLists(_mainGame.PlayerList);
                //hopefully no need for the other controls since something else handles it now.
            }
            else
            {
                _score.Visibility = Visibility.Collapsed;
            }
            _tileBoard1.Init(_model);
            _gameBoard1.LoadList(_gameBoard, ThreeLetterFunCardGraphicsCP.TagUsed);
            Content = mainStack;
        }
Esempio n. 9
0
 public static void RemoveTiles(this CustomBasicList <TileInformation> thisList, ThreeLetterFunVMData model)
 {
     thisList.RemoveRange(0, 2);
     model.TileBoard1 !.UpdateBoard(); //i think
 }