public RollEmMainView(IEventAggregator aggregator, TestOptions test, RollEmVMData model, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); register.RegisterControl(_board.Element, ""); graphicsCP.LinkBoard(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RollEmMainViewModel.RestoreScreen) }; } StackPanel tempStack = new StackPanel(); mainStack.Children.Add(tempStack); tempStack.Orientation = Orientation.Horizontal; tempStack.Children.Add(_board); var thisRoll = GetGamingButton("Roll Dice", nameof(RollEmMainViewModel.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(RollEmMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); mainStack.Children.Add(otherStack); _score = new ScoreBoardWPF(); _score.AddColumn("Score Round", true, nameof(RollEmPlayerItem.ScoreRound)); _score.AddColumn("Score Game", true, nameof(RollEmPlayerItem.ScoreGame)); tempStack.Children.Add(_score); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RollEmMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Round", nameof(RollEmMainViewModel.Round)); //if you don't need, it comment it out. firstInfo.AddRow("Status", nameof(RollEmMainViewModel.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 BuncoDiceGameMainView(IEventAggregator aggregator) { _aggregator = aggregator; _aggregator.Subscribe(this); Grid thisGrid = new Grid(); AddAutoColumns(thisGrid, 2); // i think 2 columns will be okay for this one. StackPanel thisStack = new StackPanel(); _thisScore = new ScoreBoardWPF(); _thisScore.AddColumn("Points", false, nameof(PlayerItem.Points)); _thisScore.AddColumn("Table", false, nameof(PlayerItem.Table)); _thisScore.AddColumn("Team", false, nameof(PlayerItem.Team)); _thisScore.AddColumn("Buncos", false, nameof(PlayerItem.Buncos)); _thisScore.AddColumn("Wins", false, nameof(PlayerItem.Wins)); _thisScore.AddColumn("Losses", false, nameof(PlayerItem.Losses)); thisStack.Children.Add(_thisScore); thisGrid.Children.Add(thisStack); thisStack = new StackPanel(); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; thisStack.Children.Add(otherStack); _thisDice = new DiceListControlWPF <SimpleDice>(); var thisBut = GetGamingButton("Roll", nameof(BuncoDiceGameMainViewModel.RollAsync)); otherStack.Children.Add(thisBut); otherStack.Children.Add(_thisDice); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Margin = new Thickness(0, 10, 0, 0); thisBut = GetGamingButton("Bunco", nameof(BuncoDiceGameMainViewModel.BuncoAsync)); otherStack.Children.Add(thisBut); thisBut = GetGamingButton("Has 21", nameof(BuncoDiceGameMainViewModel.Human21Async)); otherStack.Children.Add(thisBut); thisBut = GetGamingButton("End Turn", nameof(BuncoDiceGameMainViewModel.EndTurnAsync)); otherStack.Children.Add(thisBut); thisStack.Children.Add(otherStack); _thisInfo = new DetailGameInformationWPF(); _thisInfo.Text = "Your Statistics"; _thisInfo.AddRow("# To Get", nameof(StatisticsInfo.NumberToGet)); _thisInfo.AddRow("Set", nameof(StatisticsInfo.Set)); _thisInfo.AddRow("Your Team", nameof(StatisticsInfo.YourTeam)); _thisInfo.AddRow("Your Points", nameof(StatisticsInfo.YourPoints)); _thisInfo.AddRow("Opponent Score", nameof(StatisticsInfo.OpponentScore)); _thisInfo.AddRow("Buncos", nameof(StatisticsInfo.Buncos)); _thisInfo.AddRow("Wins", nameof(StatisticsInfo.Wins)); _thisInfo.AddRow("Losses", nameof(StatisticsInfo.Losses)); _thisInfo.AddRow("Your Table", nameof(StatisticsInfo.YourTable)); _thisInfo.AddRow("Team Mate", nameof(StatisticsInfo.TeamMate)); _thisInfo.AddRow("Opponent 1", nameof(StatisticsInfo.Opponent1)); _thisInfo.AddRow("Opponent 2", nameof(StatisticsInfo.Opponent2)); _thisInfo.AddRow("Status", nameof(StatisticsInfo.Status)); thisStack.Children.Add(_thisInfo); AddControlToGrid(thisGrid, thisStack, 0, 1); Content = thisGrid; }
public PassOutDiceGameMainView(IEventAggregator aggregator, TestOptions test, PassOutDiceGameVMData model, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; register.RegisterControl(_board.ThisElement, ""); //hopefully okay. graphicsCP.LinkBoard(); if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(PassOutDiceGameMainViewModel.RestoreScreen) }; } StackPanel finalStack = new StackPanel(); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(finalStack); otherStack.Children.Add(_board); var endButton = GetGamingButton("End Turn", nameof(PassOutDiceGameMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(PassOutDiceGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(PassOutDiceGameMainViewModel.Status)); finalStack.Children.Add(firstInfo.GetContent); finalStack.Children.Add(endButton); finalStack.Children.Add(_diceControl); 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; }
readonly DiceListControlWPF <EightSidedDice> _diceControl; //i think. public SinisterSixMainView(IEventAggregator aggregator, TestOptions test, SinisterSixVMData 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(SinisterSixMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(SinisterSixMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <EightSidedDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); var endButton = GetGamingButton("End Turn", nameof(SinisterSixMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(endButton); mainStack.Children.Add(otherStack); var otherButton = GetGamingButton("Remove Selected Dice", nameof(SinisterSixMainViewModel.RemoveDiceAsync)); otherButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(otherButton); _score = new ScoreBoardWPF(); _score.AddColumn("Score", true, nameof(SinisterSixPlayerItem.Score)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(SinisterSixMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Roll", nameof(SinisterSixMainViewModel.RollNumber)); //if you don't need, it comment it out. firstInfo.AddRow("Status", nameof(SinisterSixMainViewModel.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; }
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; }
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; }
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; }
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; }
readonly DiceListControlWPF <SimpleDice> _diceControl; //i think. public ShipCaptainCrewMainView(IEventAggregator aggregator, TestOptions test, ShipCaptainCrewVMData 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(ShipCaptainCrewMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(ShipCaptainCrewMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); mainStack.Children.Add(otherStack); _score = new ScoreBoardWPF(); _score.UseAbbreviationForTrueFalse = false; _score.AddColumn("Score", true, nameof(ShipCaptainCrewPlayerItem.Score)); _score.AddColumn("Out", true, nameof(ShipCaptainCrewPlayerItem.WentOut), useTrueFalse: true); _score.AddColumn("Wins", true, nameof(ShipCaptainCrewPlayerItem.Wins)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ShipCaptainCrewMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Roll", nameof(ShipCaptainCrewMainViewModel.RollNumber)); //if you don't need, it comment it out. firstInfo.AddRow("Status", nameof(ShipCaptainCrewMainViewModel.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; }
public RollerView(PaydayVMData model) { StackPanel stack = new StackPanel(); var thisRoll = GetGamingButton("Roll Dice", nameof(RollerViewModel.RollDiceAsync)); stack.Children.Add(thisRoll); DiceListControlWPF <SimpleDice> dice = new DiceListControlWPF <SimpleDice>(); dice.LoadDiceViewModel(model.Cup !); stack.Children.Add(dice); Content = stack; }
public SnakesAndLaddersMainView(IEventAggregator aggregator, TestOptions test, SnakesAndLaddersMainGameClass mainGame, SnakesAndLaddersVMData model ) { _aggregator = aggregator; _mainGame = mainGame; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(SnakesAndLaddersMainViewModel.RestoreScreen) }; } _privateBoard = new GameboardWPF(); _privateBoard.Margin = new Thickness(5, 5, 5, 5); _privateBoard.HorizontalAlignment = HorizontalAlignment.Left; _privateBoard.VerticalAlignment = VerticalAlignment.Top; mainStack.Children.Add(_privateBoard); var thisRoll = GetGamingButton("Roll Dice", nameof(SnakesAndLaddersMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(thisRoll); _pieceTurn = new GamePieceWPF(); _pieceTurn.Width = 80; _pieceTurn.Height = 80; // try this way. _pieceTurn.Margin = new Thickness(10, 0, 0, 0); _pieceTurn.NeedsSubscribe = false; // won't notify in this case. just let them know when new turn. otherwise, when this number changes, it will trigger for the gameboard (which is not good) _pieceTurn.Init(); otherStack.Children.Add(_pieceTurn); otherStack.Children.Add(_diceControl); mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(SnakesAndLaddersMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(SnakesAndLaddersMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public DiceDominosMainView(IEventAggregator aggregator, TestOptions test, DiceDominosVMData model, GameBoardCP gameBoard ) { _aggregator = aggregator; _model = model; _gameBoard = gameBoard; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(DiceDominosMainViewModel.RestoreScreen) }; } _gameBoard1 = new CardBoardWPF <SimpleDominoInfo, ts, DominosWPF <SimpleDominoInfo> >(); mainStack.Children.Add(_gameBoard1); var thisRoll = GetGamingButton("Roll Dice", nameof(DiceDominosMainViewModel.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(DiceDominosMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(otherStack); mainStack.Children.Add(endButton); _score = new ScoreBoardWPF(); //anything you need for the scoreboard. _score.AddColumn("Dominos Won", true, nameof(DiceDominosPlayerItem.DominosWon), rightMargin: 10); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(DiceDominosMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Status", nameof(DiceDominosMainViewModel.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; }
public SequenceDiceMainView(IEventAggregator aggregator, TestOptions test, SequenceDiceVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _board = new GameBoardWPF(); _board.Margin = new Thickness(3); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(tempStack); tempStack.Children.Add(_board); if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(SequenceDiceMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(SequenceDiceMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(SequenceDiceMainViewModel.NormalTurn)); firstInfo.AddRow("Instructions", nameof(SequenceDiceMainViewModel.Instructions)); firstInfo.AddRow("Status", nameof(SequenceDiceMainViewModel.Status)); //if we need to put to main, just change to main (?) tempStack.Children.Add(firstInfo.GetContent); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
readonly DiceListControlWPF <TenSidedDice> _diceControl; //i think. public DeadDie96MainView(IEventAggregator aggregator, TestOptions test, DeadDie96VMData 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(DeadDie96MainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(DeadDie96MainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <TenSidedDice>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); mainStack.Children.Add(otherStack); _score = new ScoreBoardWPF(); _score.AddColumn("Current Score", true, nameof(DeadDie96PlayerItem.CurrentScore)); _score.AddColumn("Total Score", true, nameof(DeadDie96PlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(DeadDie96MainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Status", nameof(DeadDie96MainViewModel.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 DiceListControlWPF <D> _diceControl; //hopefully still okay (?) public YahtzeeMainView(IEventAggregator aggregator, YahtzeeVMData <D> model) { _aggregator = aggregator; _model = model; _aggregator.Publish(this); _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _diceControl = new DiceListControlWPF <D>(); Grid eGrid = new Grid(); GridHelper.AddAutoColumns(eGrid, 2); GridHelper.AddAutoRows(eGrid, 2); ParentSingleUIContainer sheetGrid = new ParentSingleUIContainer() { Name = nameof(YahtzeeMainViewModel <D> .CurrentScoresheet) }; StackPanel stack = new StackPanel(); GridHelper.AddControlToGrid(eGrid, sheetGrid, 0, 0); GridHelper.AddControlToGrid(eGrid, stack, 0, 1); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(YahtzeeMainViewModel <D> .NormalTurn)); firstInfo.AddRow("Roll", nameof(YahtzeeMainViewModel <D> .RollNumber)); // its bound now. firstInfo.AddRow("Status", nameof(YahtzeeMainViewModel <D> .Status)); firstInfo.AddRow("Turn #", nameof(YahtzeeMainViewModel <D> .Round)); // i think stack.Children.Add(firstInfo.GetContent); _score = new ScoreBoardWPF(); _score.AddColumn("Points", false, nameof(YahtzeePlayerItem <D> .Points)); stack.Children.Add(_score); var thisRoll = GetGamingButton("Roll Dice", nameof(YahtzeeMainViewModel <D> .RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <D>(); otherStack.Children.Add(_diceControl); otherStack.Children.Add(thisRoll); GridHelper.AddControlToGrid(eGrid, otherStack, 1, 0); Grid.SetColumnSpan(otherStack, 2); Content = eGrid; }
public FillOrBustMainView(IEventAggregator aggregator, TestOptions test, FillOrBustVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _diceControl = new DiceListControlWPF <SimpleDice>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FillOrBustMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. mainStack.Children.Add(otherStack); _score.AddColumn("Current Score", true, nameof(FillOrBustPlayerItem.CurrentScore), rightMargin: 10); _score.AddColumn("Total Score", true, nameof(FillOrBustPlayerItem.TotalScore), rightMargin: 10); otherStack.Children.Add(_score); mainStack.Children.Add(_diceControl); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); var button = GetGamingButton("Roll Dice", nameof(FillOrBustMainViewModel.RollDiceAsync)); button.Margin = new Thickness(0, 0, 5, 0); otherStack.Children.Add(button); button = GetGamingButton("Remove Dice", nameof(FillOrBustMainViewModel.ChooseDiceAsync)); button.Margin = new Thickness(0, 0, 5, 0); otherStack.Children.Add(button); var endButton = GetGamingButton("End Turn", nameof(FillOrBustMainViewModel.EndTurnAsync)); otherStack.Children.Add(endButton); SimpleLabelGrid tempInfo = new SimpleLabelGrid(); tempInfo.AddRow("Temporary Score", nameof(FillOrBustMainViewModel.TempScore)); tempInfo.AddRow("Score", nameof(FillOrBustMainViewModel.DiceScore)); otherStack.Children.Add(tempInfo.GetContent); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FillOrBustMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FillOrBustMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public AggravationMainView(IEventAggregator aggregator, TestOptions test, AggravationVMData model, AggravationGameContainer gameContainer, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); register.RegisterControl(_board.ThisElement, ""); graphicsCP.LinkBoard(); _ourPiece = new MarblePiecesWPF <EnumColorChoice>(); _ourPiece.Width = 80; _ourPiece.Height = 80; _ourPiece.Init(); //i think. StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(AggravationMainViewModel.RestoreScreen) }; } Grid tempGrid = new Grid(); mainStack.Children.Add(tempGrid); var thisRoll = GetGamingButton("Roll Dice", nameof(AggravationMainViewModel.RollDiceAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(AggravationMainViewModel.NormalTurn)); firstInfo.AddRow("Instructions", nameof(AggravationMainViewModel.Instructions)); firstInfo.AddRow("Status", nameof(AggravationMainViewModel.Status)); //if we need to put to main, just change to main (?) StackPanel firstStack = new StackPanel(); firstStack.Margin = new Thickness(3, 3, 3, 3); firstStack.Children.Add(firstInfo.GetContent); firstStack.Children.Add(_ourPiece); otherStack.Children.Add(thisRoll); otherStack.Children.Add(_diceControl); firstStack.Children.Add(otherStack); tempGrid.Children.Add(firstStack); 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 ClueBoardGameMainView(IEventAggregator aggregator, TestOptions test, ClueBoardGameVMData model, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register, ClueBoardGameMainGameClass mainGame, ClueBoardGameGameContainer gameContainer ) { _mainGame = mainGame; _gameContainer = gameContainer; _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); register.RegisterControl(_board.ThisElement, ""); graphicsCP.LinkBoard(); _piece = new PawnPiecesWPF <EnumColorChoice>(); _piece.Height = 60; _piece.Width = 60; _piece.Init(); _pile = new BasePileWPF <CardInfo, CardCP, CardWPF>(); _hand = new BaseHandWPF <CardInfo, CardCP, CardWPF>(); _detective = new DetectiveNotebookWPF(); _prediction = new PredictionAccusationWPF(); StackPanel mainStack = new StackPanel(); StackPanel finalStack = new StackPanel() { Orientation = Orientation.Horizontal }; ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(ClueBoardGameMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(ClueBoardGameMainViewModel.RollDiceAsync)); var preButton = GetGamingButton("Predict", nameof(ClueBoardGameMainViewModel.MakePredictionAsync)); var accusationButton = GetGamingButton("Accusation", nameof(ClueBoardGameMainViewModel.MakeAccusationAsync)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); var endButton = GetGamingButton("End Turn", nameof(ClueBoardGameMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ClueBoardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(ClueBoardGameMainViewModel.Status)); StackPanel firstRowStack = new StackPanel(); firstRowStack.Children.Add(_board); otherStack.Children.Add(_piece); otherStack.Children.Add(firstInfo.GetContent); firstRowStack.Children.Add(otherStack); finalStack.Children.Add(firstRowStack); StackPanel secondRowStack = new StackPanel(); finalStack.Children.Add(secondRowStack); StackPanel thirdRowStack = new StackPanel(); finalStack.Children.Add(thirdRowStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_hand); otherStack.Children.Add(_pile); secondRowStack.Children.Add(otherStack); _prediction.Margin = new Thickness(0, 0, 0, 30); secondRowStack.Children.Add(_prediction); secondRowStack.Children.Add(_detective); AddVerticalLabelGroup("Instructions", nameof(ClueBoardGameMainViewModel.Instructions), thirdRowStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_diceControl); TextBlock label = new TextBlock(); label.FontSize = 100; label.Foreground = Brushes.White; label.FontWeight = FontWeights.Bold; label.SetBinding(TextBlock.TextProperty, new Binding(nameof(ClueBoardGameMainViewModel.LeftToMove))); otherStack.Children.Add(label); thirdRowStack.Children.Add(otherStack); thirdRowStack.Children.Add(thisRoll); thirdRowStack.Children.Add(preButton); thirdRowStack.Children.Add(accusationButton); thirdRowStack.Children.Add(endButton); var nextInfo = new SimpleLabelGrid(); nextInfo.AddRow("Room", nameof(ClueBoardGameMainViewModel.CurrentRoomName)); nextInfo.AddRow("Character", nameof(ClueBoardGameMainViewModel.CurrentCharacterName)); nextInfo.AddRow("Weapon", nameof(ClueBoardGameMainViewModel.CurrentWeaponName)); thirdRowStack.Children.Add(nextInfo.GetContent); mainStack.Children.Add(finalStack); 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 BackgammonMainView(IEventAggregator aggregator, TestOptions test, BackgammonVMData model, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; register.RegisterControl(_board.ThisElement, "main"); graphicsCP.LinkBoard(); if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(BackgammonMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _diceControl = new DiceListControlWPF <SimpleDice>(); otherStack.Children.Add(_board); StackPanel finalStack = new StackPanel(); StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; var endButton = GetGamingButton("End Turn", nameof(BackgammonMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(otherStack); Button other = GetGamingButton("Undo All Moves", nameof(BackgammonMainViewModel.UndoMoveAsync)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(BackgammonMainViewModel.NormalTurn)); firstInfo.AddRow("Game Status", nameof(BackgammonMainViewModel.Status)); firstInfo.AddRow("Moves Made", nameof(BackgammonMainViewModel.MovesMade)); firstInfo.AddRow("Last Status", nameof(BackgammonMainViewModel.LastStatus)); firstInfo.AddRow("Instructions", nameof(BackgammonMainViewModel.Instructions)); tempStack.Children.Add(endButton); tempStack.Children.Add(other); tempStack.Children.Add(_diceControl); finalStack.Children.Add(tempStack); finalStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(finalStack); //if we need to put to main, just change to main (?) if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public ThinkTwiceMainView(IEventAggregator aggregator, TestOptions test, ThinkTwiceVMData model, IGamePackageResolver resolver, ThinkTwiceGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _resolver = resolver; _gameContainer = gameContainer; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); _multStack = new StackPanel() { Orientation = Orientation.Horizontal }; StackPanel firsts = new StackPanel(); StackPanel otherStack = new StackPanel() { Orientation = Orientation.Horizontal }; _diceControl = new DiceListControlWPF <SimpleDice>(); firsts.Children.Add(_multStack); firsts.Children.Add(_diceControl); Grid grid = new Grid(); StackPanel columnStack = new StackPanel(); AddControlToGrid(grid, columnStack, 0, 0); AddLeftOverColumn(grid, 70); AddLeftOverColumn(grid, 30); mainStack.Children.Add(grid); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(ThinkTwiceMainViewModel.RestoreScreen) }; } var thisRoll = GetGamingButton("Roll Dice", nameof(ThinkTwiceMainViewModel.RollDiceAsync)); var endButton = GetGamingButton("End Turn", nameof(ThinkTwiceMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; _score = new ScoreBoardWPF(); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(ThinkTwiceMainViewModel.ScoreScreen) }; AddControlToGrid(grid, parent, 0, 1); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ThinkTwiceMainViewModel.NormalTurn)); // there is no roll number needed for this game. firstInfo.AddRow("Roll", nameof(ThinkTwiceMainViewModel.RollNumber)); //if you don't need, it comment it out. firstInfo.AddRow("Category", nameof(ThinkTwiceMainViewModel.CategoryChosen)); firstInfo.AddRow("Score", nameof(ThinkTwiceMainViewModel.Score)); firstInfo.AddRow("Status", nameof(ThinkTwiceMainViewModel.Status)); firsts.Children.Add(firstInfo.GetContent); otherStack.Children.Add(firsts); StackPanel seconds = new StackPanel(); var thisBut = GetGamingButton("Roll Multiplier Dice", nameof(ThinkTwiceMainViewModel.RollMultAsync)); seconds.Children.Add(thisBut); seconds.Children.Add(thisRoll); seconds.Children.Add(endButton); otherStack.Children.Add(seconds); columnStack.Children.Add(otherStack); columnStack.Children.Add(_score); _score.AddColumn("Score Round", true, nameof(ThinkTwicePlayerItem.ScoreRound)); _score.AddColumn("Score Game", true, nameof(ThinkTwicePlayerItem.ScoreGame)); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }