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 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 PickelCardGameMainView(IEventAggregator aggregator, TestOptions test, PickelCardGameVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); GamePackageViewModelBinder.ManuelElements.Clear(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <PickelCardGameCardInformation, ts, DeckOfCardsWPF <PickelCardGameCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, PickelCardGameCardInformation, ts, DeckOfCardsWPF <PickelCardGameCardInformation> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(PickelCardGameMainViewModel.RestoreScreen) }; } PopulateScores(_score); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(PickelCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(PickelCardGameMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(PickelCardGameMainViewModel.Status)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); 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 LottoDominosMainView(IEventAggregator aggregator, TestOptions test, LottoDominosMainGameClass mainGame ) { _aggregator = aggregator; _mainGame = mainGame; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(LottoDominosMainViewModel.RestoreScreen) }; } ParentSingleUIContainer choose = new ParentSingleUIContainer() { Name = nameof(LottoDominosMainViewModel.ChooseScreen) }; mainStack.Children.Add(choose); ParentSingleUIContainer board = new ParentSingleUIContainer() { Name = nameof(LottoDominosMainViewModel.BoardScreen) }; mainStack.Children.Add(board); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(LottoDominosMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(LottoDominosMainViewModel.Status)); mainStack.Children.Add(firstInfo.GetContent); _score1 = new ScoreBoardWPF(); _score1.AddColumn("# Chosen", true, nameof(LottoDominosPlayerItem.NumberChosen)); _score1.AddColumn("# Won", true, nameof(LottoDominosPlayerItem.NumberWon)); mainStack.Children.Add(_score1); 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 <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; }
public RageCardGameMainView(IEventAggregator aggregator, TestOptions test, RageCardGameVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF>(); _trick1 = new SeveralPlayersTrickWPF <EnumColor, RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF, RageCardGamePlayerItem>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RageCardGameMainViewModel.RestoreScreen) }; } PopulateScores(_score); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RageCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(RageCardGameMainViewModel.Status)); firstInfo.AddRow("Trump", nameof(RageCardGameMainViewModel.TrumpSuit)); firstInfo.AddRow("Lead", nameof(RageCardGameMainViewModel.Lead)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); 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 ConcentrationMainView(IEventAggregator aggregator, TestOptions test, ConcentrationVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _board = new BasicMultiplePilesWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(ConcentrationMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_board); mainStack.Children.Add(otherStack); _score.AddColumn("Pairs", true, nameof(ConcentrationPlayerItem.Pairs)); //very common. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ConcentrationMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(ConcentrationMainViewModel.Status)); StackPanel finalStack = new StackPanel(); otherStack.Children.Add(finalStack); finalStack.Children.Add(firstInfo.GetContent); finalStack.Children.Add(_score); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public LifeScoreboardView(LifeBoardGameGameContainer gameContainer) { ScoreBoardWPF score = new ScoreBoardWPF(); score.AddColumn("Money", true, nameof(LifeBoardGamePlayerItem.MoneyEarned), useCurrency: true, rightMargin: 10); score.AddColumn("Loans", true, nameof(LifeBoardGamePlayerItem.Loans), useCurrency: true, rightMargin: 10); score.AddColumn("Stock 1", true, nameof(LifeBoardGamePlayerItem.FirstStock)); score.AddColumn("Stock 2", true, nameof(LifeBoardGamePlayerItem.SecondStock)); score.AddColumn("Career", true, nameof(LifeBoardGamePlayerItem.Career1), rightMargin: 10); score.AddColumn("Salary", true, nameof(LifeBoardGamePlayerItem.Salary), useCurrency: true, rightMargin: 10); score.AddColumn("Tiles", true, nameof(LifeBoardGamePlayerItem.TilesCollected)); score.AddColumn("Car I.", true, nameof(LifeBoardGamePlayerItem.CarIsInsured), useTrueFalse: true); score.AddColumn("House I.", true, nameof(LifeBoardGamePlayerItem.HouseIsInsured), useTrueFalse: true); score.AddColumn("House N.", true, nameof(LifeBoardGamePlayerItem.HouseName)); score.AddColumn("S Career", true, nameof(LifeBoardGamePlayerItem.Career2)); score.LoadLists(gameContainer.PlayerList !); Content = score; }
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 ConnectTheDotsMainView(IEventAggregator aggregator, TestOptions test, GameBoardGraphicsCP graphicsCP, IGamePackageRegister register ) { _aggregator = aggregator; _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(ConnectTheDotsMainViewModel.RestoreScreen) }; } _score = new ScoreBoardWPF(); _score.AddColumn("Score", true, nameof(ConnectTheDotsPlayerItem.Score)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(ConnectTheDotsMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(ConnectTheDotsMainViewModel.Status)); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_board); mainStack.Children.Add(otherStack); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(firstInfo.GetContent); finalStack.Children.Add(_score); otherStack.Children.Add(finalStack); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public RageColorView(RageCardGameVMData model, RageCardGameGameContainer gameContainer) { StackPanel stack = new StackPanel(); BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF> hand = new BaseHandWPF <RageCardGameCardInformation, RageCardGameGraphicsCP, CardGraphicsWPF>(); ScoreBoardWPF score = new ScoreBoardWPF(); RageCardGameMainView.PopulateScores(score); SimpleLabelGrid details = new SimpleLabelGrid(); details.AddRow("Trump", nameof(RageColorViewModel.TrumpSuit)); details.AddRow("Lead", nameof(RageColorViewModel.Lead)); EnumPickerWPF <CheckerChoiceCP <EnumColor>, CheckerChooserWPF <EnumColor>, EnumColor> piece = new EnumPickerWPF <CheckerChoiceCP <EnumColor>, CheckerChooserWPF <EnumColor>, EnumColor>(); stack.Children.Add(piece); stack.Children.Add(hand); stack.Children.Add(details.GetContent); stack.Children.Add(score); Content = stack; score !.LoadLists(gameContainer.SaveRoot.PlayerList); hand !.LoadList(model.PlayerHand1 !, ""); piece.LoadLists(model.Color1); }
public OpetongMainView(IEventAggregator aggregator, TestOptions test, OpetongVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard>, RummySet, SavedSet>(); _poolG = new CardBoardWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(OpetongMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_poolG); _poolG.HorizontalAlignment = HorizontalAlignment.Left; _poolG.VerticalAlignment = VerticalAlignment.Top; _tempG.Height = 350; otherStack.Children.Add(_tempG); var button = GetGamingButton("Lay Down Single Set", nameof(OpetongMainViewModel.PlaySetAsync)); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(OpetongPlayerItem.ObjectCount)); //very common. _score.AddColumn("Sets Played", true, nameof(OpetongPlayerItem.SetsPlayed)); _score.AddColumn("Score", true, nameof(OpetongPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(OpetongMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(OpetongMainViewModel.Status)); firstInfo.AddRow("Instructions", nameof(OpetongMainViewModel.Instructions)); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(_score); finalStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(finalStack); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(_mainG); _deckGPile.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 GalaxyCardGameMainView(IEventAggregator aggregator, TestOptions test, GalaxyCardGameVMData model, GalaxyCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _model.WinUI = this; _gameContainer = gameContainer; _aggregator.Subscribe(this); gameContainer.SaveRoot.LoadWin(this); _deckGPile = new BaseDeckWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, GalaxyCardGameCardInformation, ts, DeckOfCardsWPF <GalaxyCardGameCardInformation> >(); _trick1.Width = 500; _nextCard = new DeckOfCardsWPF <GalaxyCardGameCardInformation>(); _planetStack = new StackPanel(); _moonGrid = new Grid(); _planetStack.Orientation = Orientation.Horizontal; AddLeftOverColumn(_moonGrid, 50); AddLeftOverColumn(_moonGrid, 50); AddAutoRows(_moonGrid, 1); _nextCard.SendSize(ts.TagUsed, _gameContainer.SaveRoot !.WinningCard); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(GalaxyCardGameMainViewModel.RestoreScreen) }; } var endButton = GetGamingButton("End Turn", nameof(GalaxyCardGameMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Top; StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_trick1); otherStack.Children.Add(_nextCard); otherStack.Children.Add(_deckGPile); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(GalaxyCardGamePlayerItem.ObjectCount)); //very common. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(GalaxyCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(GalaxyCardGameMainViewModel.Status)); mainStack.Children.Add(_moonGrid); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_playerHandWPF); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(firstInfo.GetContent); var button = GetGamingButton("Create New Moon", nameof(GalaxyCardGameMainViewModel.MoonAsync)); finalStack.Children.Add(endButton); finalStack.Children.Add(button); otherStack.Children.Add(finalStack); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_planetStack); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); _deckGPile.Margin = new Thickness(5, 5, 5, 5); 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 A8RoundRummyMainView(IEventAggregator aggregator, TestOptions test, A8RoundRummyVMData model, A8RoundRummyGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <A8RoundRummyCardInformation, A8RoundRummyGraphicsCP, CardGraphicsWPF>(); _roundControl = new RoundUI(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(A8RoundRummyMainViewModel.RestoreScreen) }; } Grid grid2 = new Grid(); AddLeftOverColumn(grid2, 60); AddLeftOverColumn(grid2, 40); // can adjust as needed AddControlToGrid(grid2, mainStack, 0, 0); _roundControl = new RoundUI(); AddControlToGrid(grid2, _roundControl, 0, 1); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. var thisBut = GetGamingButton("Go Out", nameof(A8RoundRummyMainViewModel.GoOutAsync)); otherStack.Children.Add(thisBut); mainStack.Children.Add(_playerHandWPF); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(A8RoundRummyMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(A8RoundRummyMainViewModel.Status)); firstInfo.AddRow("Next", nameof(A8RoundRummyMainViewModel.NextTurn)); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(A8RoundRummyPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(A8RoundRummyPlayerItem.TotalScore)); mainStack.Children.Add(_score); _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 = grid2; }
public BladesOfSteelMainView(IEventAggregator aggregator, TestOptions test, BladesOfSteelVMData model, BladesOfSteelGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _discardGPile = new BasePileWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _mainDefenseCards = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _opponentDefense = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _opponentAttack = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _yourDefense = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); _yourAttack = new BaseHandWPF <RegularSimpleCard, ts, DeckOfCardsWPF <RegularSimpleCard> >(); ScoringGuideWPF tempScore = new ScoringGuideWPF(); _score.AddColumn("Cards Left", true, nameof(BladesOfSteelPlayerItem.ObjectCount), rightMargin: 5); _score.AddColumn("Score", true, nameof(BladesOfSteelPlayerItem.Score), rightMargin: 5); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(BladesOfSteelMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(tempScore); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); StackPanel firstStack = new StackPanel(); AddVerticalLabelGroup("Instructions", nameof(BladesOfSteelMainViewModel.Instructions), firstStack); otherStack.Children.Add(firstStack); Grid playerArea = new Grid(); AddAutoColumns(playerArea, 3); AddAutoRows(playerArea, 2); _opponentDefense.Margin = new Thickness(0, 0, 0, 20); AddControlToGrid(playerArea, _opponentDefense, 0, 2); AddControlToGrid(playerArea, _opponentAttack, 0, 1); _opponentAttack.Margin = new Thickness(0, 0, 0, 20); AddControlToGrid(playerArea, _mainDefenseCards, 1, 0); AddControlToGrid(playerArea, _yourAttack, 1, 1); AddControlToGrid(playerArea, _yourDefense, 1, 2); mainStack.Children.Add(playerArea); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); AddControlToGrid(playerArea, otherStack, 0, 0); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); var endButton = GetGamingButton("End Turn", nameof(BladesOfSteelMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Center; otherStack.Children.Add(endButton); var otherBut = GetGamingButton("Pass", nameof(BladesOfSteelMainViewModel.PassAsync)); otherStack.Children.Add(otherBut); otherBut.HorizontalAlignment = HorizontalAlignment.Left; otherBut.VerticalAlignment = VerticalAlignment.Center; otherStack.Children.Add(_playerHandWPF); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } _score !.LoadLists(gameContainer.PlayerList !); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think _discardGPile !.Init(_model.Pile1 !, ts.TagUsed); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ts.TagUsed); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _mainDefenseCards !.LoadList(_model.MainDefense1 !, ts.TagUsed); _yourAttack !.LoadList(_model.YourAttackPile !, ts.TagUsed); _yourDefense !.LoadList(_model.YourDefensePile !, ts.TagUsed); _opponentAttack !.LoadList(_model.OpponentAttackPile !, ts.TagUsed); _opponentDefense !.LoadList(_model.OpponentDefensePile !, ts.TagUsed); Content = mainStack; }
public MonopolyCardGameMainView(IEventAggregator aggregator, TestOptions test, MonopolyCardGameVMData model, MonopolyCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <MonopolyCardGameCardInformation, MonopolyCardGameGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(MonopolyCardGameMainViewModel.RestoreScreen) }; } mainStack.Children.Add(_cardDetail); Grid finalGrid = new Grid(); AddPixelColumn(finalGrid, 900); AddAutoColumns(finalGrid, 1); _tradeStack.Orientation = Orientation.Horizontal; AddControlToGrid(finalGrid, _tradeStack, 0, 1); AddControlToGrid(finalGrid, mainStack, 0, 0); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); StackPanel tempStack = new StackPanel(); var thisBut = GetGamingButton("Resume", nameof(MonopolyCardGameMainViewModel.ResumeAsync)); tempStack.Children.Add(thisBut); thisBut = GetGamingButton("Go Out", nameof(MonopolyCardGameMainViewModel.GoOutAsync)); tempStack.Children.Add(thisBut); otherStack.Children.Add(tempStack); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(MonopolyCardGamePlayerItem.ObjectCount)); //very common. _score.AddColumn("Previous Money", true, nameof(MonopolyCardGamePlayerItem.PreviousMoney), useCurrency: true); _score.AddColumn("Total Money", true, nameof(MonopolyCardGamePlayerItem.TotalMoney), useCurrency: true); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(MonopolyCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(MonopolyCardGameMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalGrid; }
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 FourSuitRummyMainView(IEventAggregator aggregator, TestOptions test, FourSuitRummyVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _discardGPile = new BasePileWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard. AddLeftOverRow(finalGrid, 80); mainStack.Children.Add(finalGrid); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. Grid firstGrid = new Grid(); AddLeftOverColumn(firstGrid, 60); // 50 was too much. if there is scrolling, i guess okay. AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary) AddAutoColumns(firstGrid, 1); // maybe 1 (well see) AddLeftOverColumn(firstGrid, 15); // for other details AddLeftOverColumn(firstGrid, 30); // for scoreboard _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; AddControlToGrid(firstGrid, otherStack, 0, 2); // i think AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think var thisBut = GetGamingButton("Play Sets", nameof(FourSuitRummyMainViewModel.PlaySetsAsync)); AddControlToGrid(firstGrid, thisBut, 0, 1); _score.AddColumn("Cards Left", true, nameof(FourSuitRummyPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(FourSuitRummyPlayerItem.TotalScore)); AddControlToGrid(firstGrid, _score, 0, 4); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FourSuitRummyMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FourSuitRummyMainViewModel.Status)); AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3); AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think _tempG.Height = 700; StackPanel thirdStack = new StackPanel(); thirdStack.Orientation = Orientation.Horizontal; thirdStack.Children.Add(_tempG); Grid setGrid = new Grid(); AddLeftOverColumn(setGrid, 50); AddLeftOverColumn(setGrid, 50); AddPixelRow(setGrid, 700); // i think this one needs that. thirdStack.Children.Add(setGrid); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.YourSetsScreen) }; AddControlToGrid(setGrid, parent, 0, 0); parent = new ParentSingleUIContainer() { Name = nameof(FourSuitRummyMainViewModel.OpponentSetsScreen) }; AddControlToGrid(setGrid, parent, 0, 1); AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); 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 FiveCrownsMainView(IEventAggregator aggregator, TestOptions test, FiveCrownsVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _tempG = new TempRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF>(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, FiveCrownsCardInformation, FiveCrownsGraphicsCP, CardGraphicsWPF, PhaseSet, SavedSet>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FiveCrownsMainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddLeftOverRow(finalGrid, 20); // has to be this way because of scoreboard. AddLeftOverRow(finalGrid, 80); mainStack.Children.Add(finalGrid); Grid firstGrid = new Grid(); AddLeftOverColumn(firstGrid, 40); // 50 was too much. if there is scrolling, i guess okay. AddLeftOverColumn(firstGrid, 10); // for buttons (can change if necessary) AddAutoColumns(firstGrid, 1); // maybe 1 (well see) AddLeftOverColumn(firstGrid, 15); // for other details AddLeftOverColumn(firstGrid, 30); // for scoreboard _deckGPile.HorizontalAlignment = HorizontalAlignment.Left; _deckGPile.VerticalAlignment = VerticalAlignment.Top; _discardGPile.HorizontalAlignment = HorizontalAlignment.Left; _discardGPile.VerticalAlignment = VerticalAlignment.Top; StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. AddControlToGrid(firstGrid, otherStack, 0, 2); // i think AddControlToGrid(firstGrid, _playerHandWPF, 0, 0); // i think var thisBut = GetGamingButton("Lay" + Constants.vbCrLf + "Down", nameof(FiveCrownsMainViewModel.LayDownSetsAsync)); StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; tempStack.Children.Add(thisBut); thisBut = GetGamingButton("Back", nameof(FiveCrownsMainViewModel.Back)); thisBut.FontSize -= 4; tempStack.Children.Add(thisBut); AddControlToGrid(firstGrid, tempStack, 0, 1); _score.AddColumn("Cards Left", true, nameof(FiveCrownsPlayerItem.ObjectCount)); //very common. _score.AddColumn("Current Score", true, nameof(FiveCrownsPlayerItem.CurrentScore)); _score.AddColumn("Total Score", true, nameof(FiveCrownsPlayerItem.TotalScore)); AddControlToGrid(firstGrid, _score, 0, 4); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FiveCrownsMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FiveCrownsMainViewModel.Status)); firstInfo.AddRow("Up To", nameof(FiveCrownsMainViewModel.UpTo)); AddControlToGrid(firstGrid, firstInfo.GetContent, 0, 3); AddControlToGrid(finalGrid, firstGrid, 0, 0); // i think _tempG.Height = 700; StackPanel thirdStack = new StackPanel(); thirdStack.Orientation = Orientation.Horizontal; thirdStack.Children.Add(_tempG); _mainG.Height = 700; // try this way. thirdStack.Children.Add(_mainG); AddControlToGrid(finalGrid, thirdStack, 1, 0); // i think _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 RummyDiceMainView(IEventAggregator aggregator, TestOptions test, RummyDiceMainGameClass mainGame ) { _aggregator = aggregator; _mainGame = mainGame; _aggregator.Subscribe(this); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RummyDiceMainViewModel.RestoreScreen) }; } StackPanel tempSets = new StackPanel(); RummyDiceHandWPF thisTemp = new RummyDiceHandWPF(); thisTemp.Index = 1; tempSets.Children.Add(thisTemp); _tempList !.Add(thisTemp); //forgot this too. thisTemp = new RummyDiceHandWPF(); thisTemp.Index = 2; tempSets.Children.Add(thisTemp); _tempList.Add(thisTemp); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(tempSets); _thisScore = new ScoreBoardWPF(); otherStack.Children.Add(_thisScore); mainStack.Children.Add(otherStack); SimpleLabelGrid otherScore = new SimpleLabelGrid(); otherScore.AddRow("Roll", nameof(RummyDiceMainViewModel.RollNumber), new RollConverter()); otherScore.AddRow("Score", nameof(RummyDiceMainViewModel.Score)); var tempGrid = otherScore.GetContent; tempGrid.VerticalAlignment = VerticalAlignment.Bottom; // try this way otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(tempGrid); Button thisBut; thisBut = GetGamingButton("Put Back", nameof(RummyDiceMainViewModel.BoardAsync)); thisBut.Margin = new Thickness(5, 0, 0, 0); otherStack.Children.Add(thisBut); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; _thisScore.AddColumn("Score Round", false, nameof(RummyDicePlayerItem.ScoreRound)); _thisScore.AddColumn("Score Game", false, nameof(RummyDicePlayerItem.ScoreGame)); _thisScore.AddColumn("Phase", false, nameof(RummyDicePlayerItem.Phase)); _thisScore.VerticalAlignment = VerticalAlignment.Top; otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); _diceControl = new RummyDiceListWPF(); thisBut = GetGamingButton("Roll", nameof(RummyDiceMainViewModel.RollAsync)); thisBut.HorizontalAlignment = HorizontalAlignment.Left; otherStack.Children.Add(thisBut); otherStack.Children.Add(_diceControl); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RummyDiceMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(RummyDiceMainViewModel.Status)); firstInfo.AddRow("Phase", nameof(RummyDiceMainViewModel.CurrentPhase)); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; StackPanel bottomStack = new StackPanel(); otherStack.Children.Add(bottomStack); var endButton = GetGamingButton("End Turn", nameof(RummyDiceMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.Margin = new Thickness(5, 0, 0, 20); bottomStack.Children.Add(endButton); thisBut = GetGamingButton("Score Hand", nameof(RummyDiceMainViewModel.CheckAsync)); thisBut.Margin = new Thickness(5, 0, 0, 0); bottomStack.Children.Add(thisBut); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); 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 RookMainView(IEventAggregator aggregator, TestOptions test, RookVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>(); _trick1 = new SeveralPlayersTrickWPF <EnumColorTypes, RookCardInformation, RookGraphicsCP, CardGraphicsWPF, RookPlayerItem>(); _dummy1 = new BaseHandWPF <RookCardInformation, RookGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.NestScreen) }; mainStack.Children.Add(parent); _score.AddColumn("Bid Amount", true, nameof(RookPlayerItem.BidAmount)); _score.AddColumn("Tricks Won", false, nameof(RookPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(RookPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(RookPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RookMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(RookMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(RookMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(_dummy1); otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.BidScreen) }; otherStack.Children.Add(parent); parent = new ParentSingleUIContainer() { Name = nameof(RookMainViewModel.ColorScreen) }; otherStack.Children.Add(parent); otherStack.Children.Add(_trick1); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public FlinchMainView(IEventAggregator aggregator, TestOptions test, FlinchVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>(); _publicGraphics = new PublicPilesWPF(); _publicGraphics.Width = 700; _publicGraphics.Height = 500; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(FlinchMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_publicGraphics); mainStack.Children.Add(otherStack); StackPanel tempStack = new StackPanel(); var thisLabel = GetDefaultLabel(); thisLabel.Text = "Cards To Reshuffle"; tempStack.Children.Add(thisLabel); otherStack.Children.Add(tempStack); thisLabel = GetDefaultLabel(); thisLabel.SetBinding(TextBlock.TextProperty, nameof(FlinchMainViewModel.CardsToShuffle)); tempStack.Children.Add(thisLabel); _score.AddColumn("In Stock", false, nameof(FlinchPlayerItem.InStock)); int x; for (x = 1; x <= 5; x++) //has to change for flinch. { var thisStr = "Discard" + x; _score.AddColumn(thisStr, false, thisStr); } _score.AddColumn("Stock Left", false, nameof(FlinchPlayerItem.StockLeft)); _score.AddColumn("Cards Left", false, nameof(FlinchPlayerItem.ObjectCount)); //very common. SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(FlinchMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FlinchMainViewModel.Status)); otherStack.Children.Add(_score); Button endButton = GetGamingButton("End Turn", nameof(FlinchMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; endButton.VerticalAlignment = VerticalAlignment.Top; otherStack.Children.Add(endButton); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_playerHandWPF); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(FlinchMainViewModel.PlayerPilesScreen) }; mainStack.Children.Add(parent); _deckGPile.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 DutchBlitzMainView(IEventAggregator aggregator, TestOptions test, DutchBlitzVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _public1.Width = 700; _public1.Height = 500; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(DutchBlitzMainViewModel.RestoreScreen) }; } StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_public1); otherStack.Children.Add(_score); _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft)); _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound)); _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame)); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. var button = GetGamingButton("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync)); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status)); firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage)); otherStack.Children.Add(firstInfo.GetContent); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_yourDiscard); otherStack.Children.Add(_yourStock); mainStack.Children.Add(otherStack); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); 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 XactikaMainView(IEventAggregator aggregator, TestOptions test, XactikaVMData model, IGamePackageRegister register, StatsBoardCP boardCP ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); register.RegisterControl(_stats1.Element, "main"); boardCP.LinkBoard(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF>(); _shape1 = new ChooseShapeWPF(); _trick1 = new SeveralPlayersTrickWPF <EnumShapes, XactikaCardInformation, XactikaGraphicsCP, CardGraphicsWPF, XactikaPlayerItem>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.RestoreScreen) }; } _score.AddColumn("Cards Left", false, nameof(XactikaPlayerItem.ObjectCount)); //very common. _score.AddColumn("Bid Amount", false, nameof(XactikaPlayerItem.BidAmount)); _score.AddColumn("Tricks Won", false, nameof(XactikaPlayerItem.TricksWon)); _score.AddColumn("Current Score", false, nameof(XactikaPlayerItem.CurrentScore)); _score.AddColumn("Total Score", false, nameof(XactikaPlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(XactikaMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(XactikaMainViewModel.Status)); firstInfo.AddRow("Round", nameof(XactikaMainViewModel.RoundNumber)); firstInfo.AddRow("Mode", nameof(XactikaMainViewModel.GameModeText)); StackPanel shapeStack = new StackPanel(); shapeStack.Children.Add(_shape1); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.ShapeScreen) }; shapeStack.Children.Add(parent); Grid tempGrid = new Grid(); AddAutoRows(tempGrid, 1); AddLeftOverColumn(tempGrid, 1); AddAutoColumns(tempGrid, 2); StackPanel tempStack = new StackPanel(); tempStack.Orientation = Orientation.Horizontal; tempStack.Children.Add(_trick1); tempStack.Children.Add(shapeStack); AddControlToGrid(tempGrid, tempStack, 0, 0); parent = new ParentSingleUIContainer() { Name = nameof(XactikaMainViewModel.BidScreen) }; AddControlToGrid(tempGrid, parent, 0, 0); // if one is visible, then the other is not AddControlToGrid(tempGrid, _stats1, 0, 2); AddControlToGrid(tempGrid, _score, 0, 1); mainStack.Children.Add(tempGrid); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = mainStack; }
public CribbageMainView(IEventAggregator aggregator, TestOptions test, CribbageVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _discardGPile = new BasePileWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _crib1 = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _main1 = new BaseHandWPF <CribbageCard, ts, DeckOfCardsWPF <CribbageCard> >(); _otherScore = new ScoreUI(); _main1.Divider = 1.5; StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(CribbageMainViewModel.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. otherStack.Children.Add(_main1); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", false, nameof(CribbagePlayerItem.ObjectCount)); //very common. _score.AddColumn("Is Skunk Hole", false, nameof(CribbagePlayerItem.IsSkunk), useTrueFalse: true); _score.AddColumn("First Position", false, nameof(CribbagePlayerItem.FirstPosition)); _score.AddColumn("Second Position", false, nameof(CribbagePlayerItem.SecondPosition)); _score.AddColumn("Score Round", false, nameof(CribbagePlayerItem.ScoreRound)); _score.AddColumn("Total Score", false, nameof(CribbagePlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(CribbageMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(CribbageMainViewModel.Status)); firstInfo.AddRow("Dealer", nameof(CribbageMainViewModel.Dealer)); SimpleLabelGrid others = new SimpleLabelGrid(); others.AddRow("Count", nameof(CribbageMainViewModel.TotalCount)); mainStack.Children.Add(_playerHandWPF); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); var button = GetGamingButton("Continue", nameof(CribbageMainViewModel.ContinueAsync)); otherStack.Children.Add(button); button = GetGamingButton("To Crib", nameof(CribbageMainViewModel.CribAsync)); otherStack.Children.Add(button); button = GetGamingButton("Play", nameof(CribbageMainViewModel.PlayAsync)); otherStack.Children.Add(button); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); otherStack.Children.Add(firstInfo.GetContent); otherStack.Children.Add(_crib1); Grid finalGrid = new Grid(); AddPixelRow(finalGrid, 300); // hopefully this is enough AddLeftOverRow(finalGrid, 1); AddLeftOverColumn(finalGrid, 70); AddLeftOverColumn(finalGrid, 30); AddControlToGrid(finalGrid, mainStack, 0, 0); Grid.SetRowSpan(mainStack, 2); StackPanel finalStack = new StackPanel(); finalStack.Children.Add(others.GetContent); finalStack.Children.Add(_otherScore); AddControlToGrid(finalGrid, finalStack, 0, 1); AddControlToGrid(finalGrid, _score, 1, 1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); 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 = finalGrid; }
public Rummy500MainView(IEventAggregator aggregator, TestOptions test, Rummy500VMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _playerHandWPF.Margin = new Thickness(5, 5, 5, 5); _playerHandWPF.HorizontalAlignment = HorizontalAlignment.Stretch; _discardRummy = new BaseHandWPF <RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard> >(); _mainG = new MainRummySetsWPF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsWPF <RegularRummyCard>, RummySet, SavedSet>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(Rummy500MainViewModel.RestoreScreen) }; } Grid finalGrid = new Grid(); AddAutoColumns(finalGrid, 1); AddLeftOverColumn(finalGrid, 1); AddControlToGrid(finalGrid, mainStack, 0, 1); StackPanel otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_deckGPile); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(Rummy500MainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(Rummy500MainViewModel.Status)); _score.AddColumn("Cards Left", false, nameof(Rummy500PlayerItem.ObjectCount)); //very common. _score.AddColumn("Points Played", false, nameof(Rummy500PlayerItem.PointsPlayed)); _score.AddColumn("Cards Played", false, nameof(Rummy500PlayerItem.CardsPlayed)); _score.AddColumn("Score Current", false, nameof(Rummy500PlayerItem.CurrentScore)); _score.AddColumn("Score Total", false, nameof(Rummy500PlayerItem.TotalScore)); otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_playerHandWPF); Button button; button = GetGamingButton("Discard Current", nameof(Rummy500MainViewModel.DiscardCurrentAsync)); otherStack.Children.Add(button); button = GetGamingButton("Create New Rummy Set", nameof(Rummy500MainViewModel.CreateSetAsync)); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); _mainG.Divider = 1.3; _mainG.Height = 550; // i think mainStack.Children.Add(_mainG); _discardRummy.Divider = 1.7; _discardRummy.HandType = HandObservable <RegularRummyCard> .EnumHandList.Vertical; _discardRummy.HorizontalAlignment = HorizontalAlignment.Left; _discardRummy.VerticalAlignment = VerticalAlignment.Stretch; AddControlToGrid(finalGrid, _discardRummy, 0, 0); _deckGPile.Margin = new Thickness(5, 5, 5, 5); 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 = finalGrid; }
public LifeCardGameMainView(IEventAggregator aggregator, TestOptions test, LifeCardGameVMData model, LifeCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); _storyStack.Orientation = Orientation.Horizontal; _currentCard = new BasePileWPF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsWPF>(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(LifeCardGameMainViewModel.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. otherStack.Children.Add(_currentCard); mainStack.Children.Add(otherStack); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; mainStack.Children.Add(otherStack); Button button; button = GetGamingButton("Years Passed", nameof(LifeCardGameMainViewModel.YearsPassedAsync)); otherStack.Children.Add(button); button = GetGamingButton("Play Card", nameof(LifeCardGameMainViewModel.PlayCardAsync)); otherStack.Children.Add(button); ParentSingleUIContainer parent = new ParentSingleUIContainer() { Name = nameof(LifeCardGameMainViewModel.OtherScreen), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top }; otherStack.Children.Add(parent); _score.AddColumn("Cards Left", true, nameof(LifeCardGamePlayerItem.ObjectCount)); //very common. _score.AddColumn("Points", true, nameof(LifeCardGamePlayerItem.Points)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(LifeCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(LifeCardGameMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); StackPanel finalStack = new StackPanel(); finalStack.Orientation = Orientation.Horizontal; finalStack.Children.Add(mainStack); finalStack.Children.Add(_storyStack); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); _currentCard.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalStack; }
public YahtzeeHandsDownMainView(IEventAggregator aggregator, TestOptions test, YahtzeeHandsDownVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _discardGPile = new BasePileWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <YahtzeeHandsDownCardInformation, YahtzeeHandsDownGraphicsCP, CardGraphicsWPF>(); _combo1 = new ComboHandWPF(); _chance1 = new ChanceSinglePileWPF(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(YahtzeeHandsDownMainViewModel.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. _chance1.Margin = new Thickness(5, 5, 5, 5); _chance1.HorizontalAlignment = HorizontalAlignment.Left; _chance1.VerticalAlignment = VerticalAlignment.Top; otherStack.Children.Add(_chance1); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(YahtzeeHandsDownPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Score", true, nameof(YahtzeeHandsDownPlayerItem.TotalScore)); _score.AddColumn("Won Last Round", true, nameof(YahtzeeHandsDownPlayerItem.WonLastRound)); _score.AddColumn("Score Round", true, nameof(YahtzeeHandsDownPlayerItem.ScoreRound)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(YahtzeeHandsDownMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(YahtzeeHandsDownMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); var otherButton = GetGamingButton("Go Out", nameof(YahtzeeHandsDownMainViewModel.GoOutAsync)); mainStack.Children.Add(otherButton); var endButton = GetGamingButton("End Turn", nameof(YahtzeeHandsDownMainViewModel.EndTurnAsync)); endButton.HorizontalAlignment = HorizontalAlignment.Left; mainStack.Children.Add(endButton); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); otherStack = new StackPanel(); otherStack.Orientation = Orientation.Horizontal; otherStack.Children.Add(mainStack); _combo1.HandType = HandObservable <ComboCardInfo> .EnumHandList.Vertical; otherStack.Children.Add(_combo1); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); 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 = otherStack; }
public RoundsCardGameMainView(IEventAggregator aggregator, TestOptions test, RoundsCardGameVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckWPF <RoundsCardGameCardInformation, ts, DeckOfCardsWPF <RoundsCardGameCardInformation> >(); _discardGPile = new BasePileWPF <RoundsCardGameCardInformation, ts, DeckOfCardsWPF <RoundsCardGameCardInformation> >(); _score = new ScoreBoardWPF(); _playerHandWPF = new BaseHandWPF <RoundsCardGameCardInformation, ts, DeckOfCardsWPF <RoundsCardGameCardInformation> >(); _trick1 = new TwoPlayerTrickWPF <EnumSuitList, RoundsCardGameCardInformation, ts, DeckOfCardsWPF <RoundsCardGameCardInformation> >(); StackPanel mainStack = new StackPanel(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer() { Name = nameof(RoundsCardGameMainViewModel.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("# In Hand", true, nameof(RoundsCardGamePlayerItem.ObjectCount)); _score.AddColumn("Tricks Won", true, nameof(RoundsCardGamePlayerItem.TricksWon)); _score.AddColumn("Rounds Won", true, nameof(RoundsCardGamePlayerItem.RoundsWon)); _score.AddColumn("Points", true, nameof(RoundsCardGamePlayerItem.CurrentPoints)); _score.AddColumn("Total Score", true, nameof(RoundsCardGamePlayerItem.TotalScore)); SimpleLabelGrid firstInfo = new SimpleLabelGrid(); firstInfo.AddRow("Turn", nameof(RoundsCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Trump", nameof(RoundsCardGameMainViewModel.TrumpSuit)); firstInfo.AddRow("Status", nameof(RoundsCardGameMainViewModel.Status)); mainStack.Children.Add(_trick1); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(_score); _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; }