public CountdownMainView(IEventAggregator aggregator, TestOptions test, CountdownVMData model, CountdownGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(CountdownMainViewModel.RestoreScreen) }; } mainStack.Children.Add(_playerStack); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <CountdownDice>(); otherStack.Children.Add(_diceControl); var endButton = GetGamingButton("End Turn", nameof(CountdownMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); var otherButton = GetGamingButton("Show Hints", nameof(CountdownMainViewModel.Hint)); otherButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(otherButton); mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(CountdownMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Round", nameof(CountdownMainViewModel.Round)); //if you don't need, it comment it out. firstInfo.AddRow("Status", nameof(CountdownMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); 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 CountdownMainViewModel(CommandContainer commandContainer, CountdownMainGameClass mainGame, CountdownVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver, IStandardRollProcesses roller, IEventAggregator aggregator ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver, roller) { _model = viewModel; _aggregator = aggregator; CommandContainer.ExecutingChanged += CommandContainer_ExecutingChanged; }
public CountdownMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, CountdownVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, CommandContainer command, CountdownGameContainer gameContainer, StandardRollProcesses <CountdownDice, CountdownPlayerItem> roller) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, command, gameContainer, roller) { _model = currentMod; //if not needed, take this out and the _model variable. _command = command; gameContainer.MakeMoveAsync = PrivateChooseNumberAsync; gameContainer.GetNumberList = GetNewNumbers; CountdownVMData.CanChooseNumber = CanChooseNumber; _gameContainer = gameContainer; _roller = roller; }