public OtherViewModel(CommandContainer commandContainer, LifeCardGameVMData model, LifeCardGameMainGameClass mainGame, LifeCardGameGameContainer gameContainer) { CommandContainer = commandContainer; _model = model; _mainGame = mainGame; _gameContainer = gameContainer; OtherText = _model.OtherText; }
public LifeStoryHand(LifeCardGameGameContainer gameContainer, LifeCardGameVMData model, int player) : base(gameContainer.Command) { _gameContainer = gameContainer; _model = model; GetPlayerIndex = player; AutoSelect = EnumAutoType.SelectOneOnly; //start with this. _myID = _gameContainer.PlayerList !.GetSelf().Id; HandList = new DeckObservableDict <LifeCardGameCardInformation>(); //try here too. }
private readonly LifeCardGameGameContainer _gameContainer; //if we don't need it, take it out. public LifeCardGameMainGameClass(IGamePackageResolver mainContainer, IEventAggregator aggregator, BasicData basicData, TestOptions test, LifeCardGameVMData currentMod, IMultiplayerSaveState state, IAsyncDelayer delay, ICardInfo <LifeCardGameCardInformation> cardInfo, CommandContainer command, LifeCardGameGameContainer gameContainer) : base(mainContainer, aggregator, basicData, test, currentMod, state, delay, cardInfo, command, gameContainer) { _model = currentMod; _command = command; _gameContainer = gameContainer; _gameContainer.ChosePlayerAsync = ChosePlayerAsync; }
private readonly LifeCardGameGameContainer _gameContainer; //if not needed, delete. public LifeCardGameMainViewModel(CommandContainer commandContainer, LifeCardGameMainGameClass mainGame, LifeCardGameVMData viewModel, BasicData basicData, TestOptions test, IGamePackageResolver resolver, LifeCardGameGameContainer gameContainer ) : base(commandContainer, mainGame, viewModel, basicData, test, resolver) { _mainGame = mainGame; _model = viewModel; _resolver = resolver; _gameContainer = gameContainer; _model.Deck1.NeverAutoDisable = true; _model.PlayerHand1.Maximum = 5; _model.CurrentPile.SendEnableProcesses(this, () => false); CommandContainer !.ExecutingChanged += CommandContainer_ExecutingChanged; _gameContainer.LoadOtherScreenAsync = LoadOtherScreenAsync; _gameContainer.CloseOtherScreenAsync = CloseOtherScreenAsync; }
public LifeCardGameMainView(IEventAggregator aggregator, TestOptions test, LifeCardGameVMData model, LifeCardGameGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _gameContainer = gameContainer; _deckGPile = new BaseDeckXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>(); _currentCard = new BasePileXF <LifeCardGameCardInformation, LifeCardGameGraphicsCP, CardGraphicsXF>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(LifeCardGameMainViewModel.RestoreScreen)); } _storyStack.Orientation = StackOrientation.Horizontal; StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.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 StackLayout(); otherStack.Orientation = StackOrientation.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(nameof(LifeCardGameMainViewModel.OtherScreen)) { HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Start }; otherStack.Children.Add(parent); _score.AddColumn("Cards Left", true, nameof(LifeCardGamePlayerItem.ObjectCount)); //very common. _score.AddColumn("Points", true, nameof(LifeCardGamePlayerItem.Points)); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(LifeCardGameMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(LifeCardGameMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_score); otherStack.Children.Add(firstInfo.GetContent); mainStack.Children.Add(otherStack); StackLayout finalStack = new StackLayout(); finalStack.Orientation = StackOrientation.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); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } Content = finalStack; }
public static async Task RepositionCardsAsync(this PlayerCollection <LifeCardGamePlayerItem> thisList, LifeCardGameMainGameClass mainGame, LifeCardGameGameContainer gameContainer, LifeCardGameVMData model) { bool rets; rets = model.CurrentPile !.PileEmpty(); LifeCardGameCardInformation?thisCard = null; EnumSelectMode thisMode = EnumSelectMode.ChoosePlayer; // must prove its card if (rets == false) { thisCard = model.CurrentPile.GetCardInfo(); if (thisCard.Action == EnumAction.Lawsuit && mainGame.OtherTurn > 0) { thisMode = EnumSelectMode.ChooseCard; } else if (thisCard.Action == EnumAction.DonateToCharity && mainGame.OtherTurn > 0) { thisMode = EnumSelectMode.ChooseCard; } else if (thisCard.Action == EnumAction.CareerSwap || thisCard.Action == EnumAction.MovingHouse || thisCard.Action == EnumAction.YourStory || thisCard.Action == EnumAction.SecondChance || thisCard.Action == EnumAction.AdoptBaby || thisCard.Action == EnumAction.LongLostRelative || thisCard.Action == EnumAction.MixUpAtVets) { thisMode = EnumSelectMode.ChooseCard; } } if (thisMode == EnumSelectMode.ChoosePlayer) { if (gameContainer.CloseOtherScreenAsync != null) { await gameContainer.CloseOtherScreenAsync(); } } else { if (thisCard !.Action == EnumAction.Lawsuit) { model.OtherText = "Give Card"; // lawsuit is larger than second chance }