public FillOrBustMainViewModel(CommandContainer commandContainer, FillOrBustMainGameClass mainGame, FillOrBustVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver) { _mainGame = mainGame; _model = viewModel; _model.Deck1.NeverAutoDisable = true; _model.Cup !.SendEnableProcesses(this, () => { return(_mainGame !.SaveRoot !.GameStatus == EnumGameStatusList.ChooseDice); });
public FillOrBustMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, FillOrBustVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <FillOrBustCardInformation> cardInfo, CommandContainer command, FillOrBustGameContainer gameContainer, StandardRollProcesses <SimpleDice, FillOrBustPlayerItem> roller ) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer) { _model = currentMod; _command = command; Roller = roller; Roller.AfterRollingAsync = AfterRollingAsync; Roller.AfterSelectUnselectDiceAsync = AfterSelectUnselectDiceAsync; Roller.CurrentPlayer = (() => SingleInfo !); //hopefully just these 2 (?) }
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 FillOrBustMainView(IEventAggregator aggregator, TestOptions test, FillOrBustVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <FillOrBustCardInformation, FillOrBustGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _diceControl = new DiceListControlXF <SimpleDice>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(FillOrBustMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. Grid firstGrid = new Grid(); AddAutoRows(firstGrid, 1); AddAutoColumns(firstGrid, 1); AddLeftOverColumn(firstGrid, 1); AddControlToGrid(firstGrid, otherStack, 0, 0); SimpleLabelGridXF tempInfo = new SimpleLabelGridXF(); tempInfo.AddRow("Temporary Score", nameof(FillOrBustMainViewModel.TempScore)); tempInfo.AddRow("Score", nameof(FillOrBustMainViewModel.DiceScore)); otherStack.Children.Add(tempInfo.GetContent); _score.AddColumn("Current Score", true, nameof(FillOrBustPlayerItem.CurrentScore), rightMargin: 10); _score.AddColumn("Total Score", true, nameof(FillOrBustPlayerItem.TotalScore), rightMargin: 10); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(FillOrBustMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(FillOrBustMainViewModel.Status)); if (ScreenUsed != EnumScreen.SmallPhone) { firstInfo.AddRow("Instructions", nameof(FillOrBustMainViewModel.Instructions)); } Grid finGrid = new Grid(); AddAutoColumns(finGrid, 1); AddAutoRows(finGrid, 2); AddLeftOverColumn(finGrid, 1); AddControlToGrid(finGrid, _score, 0, 0); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; var button = GetSmallerButton("Roll Dice", nameof(FillOrBustMainViewModel.RollDiceAsync)); button.Margin = new Thickness(0, 0, 5, 0); otherStack.Children.Add(button); button = GetSmallerButton("Remove Dice", nameof(FillOrBustMainViewModel.ChooseDiceAsync)); button.Margin = new Thickness(0, 0, 5, 0); otherStack.Children.Add(button); var endButton = GetSmallerButton("End Turn", nameof(FillOrBustMainViewModel.EndTurnAsync)); otherStack.Children.Add(endButton); otherStack.Children.Add(tempInfo.GetContent); var temps = firstInfo.GetContent; AddControlToGrid(finGrid, temps, 1, 0); Grid.SetColumnSpan(temps, 2); AddControlToGrid(firstGrid, finGrid, 0, 1); mainStack.Children.Add(firstGrid); mainStack.Children.Add(_diceControl); mainStack.Children.Add(otherStack); _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; }