Esempio n. 1
0
 public GameBoardProcesses(TroubleGameContainer gameContainer, TroubleVMData model, GameBoardGraphicsCP graphicsCP)
 {
     _gameContainer = gameContainer;
     _model         = model;
     _graphicsCP    = graphicsCP;
     LoadBoard();
     _gameContainer.IsValidMove = IsValidMove;
 }
Esempio n. 2
0
        public TroubleMainView(IEventAggregator aggregator,
                               TestOptions test,
                               TroubleVMData model,
                               TroubleGameContainer gameContainer,
                               GameBoardGraphicsCP graphicsCP,
                               IGamePackageRegister register
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _graphicsCP = graphicsCP;
            _aggregator.Subscribe(this);
            gameContainer.PositionDice = PositionDice;
            register.RegisterControl(_board.ThisElement, "");
            graphicsCP.LinkBoard();
            StackPanel mainStack             = new StackPanel();
            ParentSingleUIContainer?restoreP = null;

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

            StackPanel otherStack = new StackPanel();

            otherStack.Orientation = Orientation.Horizontal;
            _diceControl           = new DiceListControlWPF <SimpleDice>();
            mainStack.Children.Add(otherStack);


            SimpleLabelGrid firstInfo = new SimpleLabelGrid();

            firstInfo.AddRow("Turn", nameof(TroubleMainViewModel.NormalTurn));
            firstInfo.AddRow("Instructions", nameof(TroubleMainViewModel.Instructions));
            firstInfo.AddRow("Status", nameof(TroubleMainViewModel.Status));
            otherStack.Children.Add(_tempGrid);
            otherStack.Children.Add(firstInfo.GetContent);
            _tempGrid.Margin = new Thickness(5);

            _tempStack.Children.Add(_diceControl);
            _tempGrid.Children.Add(_board);

            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        public TroubleMainView(IEventAggregator aggregator,
                               TestOptions test,
                               TroubleVMData model,
                               TroubleGameContainer gameContainer,
                               GameBoardGraphicsCP graphicsCP,
                               IGamePackageRegister register
                               )
        {
            _aggregator = aggregator;
            _model      = model;
            _graphicsCP = graphicsCP;
            _aggregator.Subscribe(this);
            gameContainer.PositionDice = PositionDice;
            register.RegisterControl(_board.ThisElement, "");
            graphicsCP.LinkBoard();
            StackLayout             mainStack = new StackLayout();
            ParentSingleUIContainer?restoreP  = null;

            if (test.SaveOption == EnumTestSaveCategory.RestoreOnly)
            {
                restoreP = new ParentSingleUIContainer(nameof(TroubleMainViewModel.RestoreScreen));
            }
            _tempGrid.Margin    = new Thickness(5, 5, 5, 5);
            _diceControl        = new DiceListControlXF <SimpleDice>();
            _diceControl.Margin = new Thickness(10, 0, 0, 0);

            var endButton = GetGamingButton("End Turn", nameof(TroubleMainViewModel.EndTurnAsync));

            endButton.HorizontalOptions = LayoutOptions.Start;


            SimpleLabelGridXF firstInfo = new SimpleLabelGridXF();

            firstInfo.AddRow("Turn", nameof(TroubleMainViewModel.NormalTurn));
            firstInfo.AddRow("Instructions", nameof(TroubleMainViewModel.Instructions));
            firstInfo.AddRow("Status", nameof(TroubleMainViewModel.Status));


            mainStack.Children.Add(_tempGrid);
            mainStack.Children.Add(firstInfo.GetContent);
            _tempStack.Children.Add(_diceControl);
            _tempStack.InputTransparent = true; //maybe this will be okay.
            _tempGrid.Children.Add(_board);


            if (restoreP != null)
            {
                //todo:  figure out where to place the restore ui if there is a restore option.
                mainStack.Children.Add(restoreP); //default add to grid but does not have to.
            }
            Content = mainStack;
        }
        private readonly TroubleMainGameClass _mainGame; //if we don't need, delete.

        public TroubleMainViewModel(CommandContainer commandContainer,
                                    TroubleMainGameClass mainGame,
                                    TroubleVMData model,
                                    BasicData basicData,
                                    TestOptions test,
                                    IGamePackageResolver resolver,
                                    IStandardRollProcesses roller,
                                    TroubleGameContainer gameContainer
                                    )
            : base(commandContainer, mainGame, model, basicData, test, resolver, roller)
        {
            _mainGame = mainGame;
            gameContainer.CanRollDice   = CanRollDice;
            gameContainer.RollDiceAsync = RollDiceAsync;
        }
 public TroubleMainGameClass(IGamePackageResolver resolver,
                             IEventAggregator aggregator,
                             BasicData basic,
                             TestOptions test,
                             TroubleVMData model,
                             IMultiplayerSaveState state,
                             IAsyncDelayer delay,
                             CommandContainer command,
                             TroubleGameContainer container,
                             StandardRollProcesses <SimpleDice, TroublePlayerItem> roller,
                             GameBoardProcesses gameBoard
                             ) : base(resolver, aggregator, basic, test, model, state, delay, command, container, roller)
 {
     _model     = model;
     _command   = command;
     _gameBoard = gameBoard;
     container.MakeMoveAsync = HumanMoveAsync;
 }