readonly DiceListControlWPF <SimpleDice> _diceControl; //i think. public YachtRaceMainView(IEventAggregator aggregator, TestOptions test, YachtRaceVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(YachtRaceMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(YachtRaceMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); var endButton = GetGamingButton("Has 5 Of A Kind", nameof(YachtRaceMainViewModel.FiveKindAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); mainStack.Children.Add(otherStack); _score = new ScoreBoardWPF(); _score.AddColumn("Time", true, nameof(YachtRacePlayerItem.Time)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(YachtRaceMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Status", nameof(YachtRaceMainViewModel.Status)); firstInfo.AddRow("Error Message", nameof(YachtRaceMainViewModel.ErrorMessage)); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); 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 YachtRaceMainViewModel(CommandContainer commandContainer, YachtRaceMainGameClass mainGame, YachtRaceVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver, IStandardRollProcesses roller ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver, roller) { _mainGame = mainGame; _model = viewModel; CommandContainer.ExecutingChanged += CommandContainer_ExecutingChanged; }
public YachtRaceMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, YachtRaceVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, CommandContainer command, BasicGameContainer <YachtRacePlayerItem, YachtRaceSaveInfo> gameContainer, StandardRollProcesses <SimpleDice, YachtRacePlayerItem> 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; }