readonly DiceListControlWPF <SimpleDice> _diceControl; //i think. public A21DiceGameMainView(IEventAggregator aggregator, TestOptions test, A21DiceGameVMData 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(A21DiceGameMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(A21DiceGameMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); var endButton = GetGamingButton("End Turn", nameof(A21DiceGameMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); mainStack.Children.Add(otherStack); _score = new ScoreBoardWPF(); //anything you need for the scoreboard. _score.AddColumn("# Of Rolls", true, nameof(A21DiceGamePlayerItem.NumberOfRolls)); _score.AddColumn("Score", true, nameof(A21DiceGamePlayerItem.Score)); _score.AddColumn("Was Tie", true, nameof(A21DiceGamePlayerItem.IsFaceOff), useTrueFalse: true); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(A21DiceGameMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Status", nameof(A21DiceGameMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
private readonly A21DiceGameMainGameClass _mainGame; //if we don't need, delete. public A21DiceGameMainViewModel(CommandContainer commandContainer, A21DiceGameMainGameClass mainGame, A21DiceGameVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver, IStandardRollProcesses roller ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver, roller) { _mainGame = mainGame; }
readonly DiceListControlXF <SimpleDice> _diceControl; //i think. public A21DiceGameMainView(IEventAggregator aggregator, TestOptions test, A21DiceGameVMData model ) { _aggregator = aggregator; _aggregator.Subscribe(this); _model = model; StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(A21DiceGameMainViewModel.RestoreScreen)); } var thisRoll = GetGamingButton("Roll Dice", nameof(A21DiceGameMainViewModel.RollDiceAsync)); StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; _diceControl = new DiceListControlXF <SimpleDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); var endButton = GetGamingButton("End Turn", nameof(A21DiceGameMainViewModel.EndTurnAsync)); endButton.HorizontalOptions = LayoutOptions.Start; otherStack.Children.Add(endButton); mainStack.Children.Add(otherStack); _score = new ScoreBoardXF(); _score.AddColumn("# Of Rolls", true, nameof(A21DiceGamePlayerItem.NumberOfRolls)); _score.AddColumn("Score", true, nameof(A21DiceGamePlayerItem.Score)); _score.AddColumn("Was Tie", true, nameof(A21DiceGamePlayerItem.IsFaceOff), useTrueFalse: true); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(A21DiceGameMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Status", nameof(A21DiceGameMainViewModel.Status)); //this is just a starting point. 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 A21DiceGameMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, A21DiceGameVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, CommandContainer command, BasicGameContainer <A21DiceGamePlayerItem, A21DiceGameSaveInfo> gameContainer, StandardRollProcesses <SimpleDice, A21DiceGamePlayerItem> roller) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, command, gameContainer, roller) { _model = currentMod; //if not needed, take this out and the _model variable. _roller = roller; }