Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. MonopolyCardGameSaveInfo save = cons !.Resolve <MonopolyCardGameSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _cardDetail !.LoadControls(_model); var thisList = _gameContainer !.PlayerList !.GetAllPlayersStartingWithSelf(); thisList.ForEach(thisPlayer => { MonopolyHandXF thisHand = new MonopolyHandXF(); thisHand.HandType = HandObservable <MonopolyCardGameCardInformation> .EnumHandList.Vertical; thisHand.Divider = 1.6; thisHand.HeightRequest = 900; thisHand.LoadList(thisPlayer.TradePile !, ""); thisPlayer.TradePile !.Scroll = thisHand; _tradeStack.Children.Add(thisHand); _customList !.Add(thisHand); }); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. LifeCardGameSaveInfo save = cons !.Resolve <LifeCardGameSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _currentCard !.Init(_model.CurrentPile !, ""); var thisList = _gameContainer !.PlayerList !.GetAllPlayersStartingWithSelf(); thisList.ForEach(thisPlayer => { LifeHandXF thisHand = new LifeHandXF(); thisHand.HandType = HandObservable <LifeCardGameCardInformation> .EnumHandList.Vertical; thisHand.Divider = 4; thisHand.HeightRequest = 900; thisHand.LoadList(thisPlayer.LifeStory !, ""); thisPlayer.LifeStory !.ThisScroll = thisHand; _storyStack !.Children.Add(thisHand); _lifeList !.Add(thisHand); }); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. SixtySix2PlayerSaveInfo save = cons !.Resolve <SixtySix2PlayerSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.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(); _trick1 !.Init(_model.TrickArea1 !, ts.TagUsed); _guide1.LoadList(_model); _marriage1 !.LoadList(_model.Marriage1 !, ts.TagUsed); var thisCard = new SixtySix2PlayerCardInformation(); IProportionImage thisP = _resolver.Resolve <IProportionImage>(ts.TagUsed); SKSize thisSize = thisCard.DefaultSize.GetSizeUsed(thisP.Proportion); var heights = thisSize.Height / 1.5f; _deckGPile.Margin = new Thickness(6, heights * -1, 0, 0); _deckStack !.Children.Add(_deckGPile); return(this.RefreshBindingsAsync(_aggregator)); }
protected override Task TryActivateAsync() { _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(); _other.Init(_model.OtherPile !, ts.TagUsed); _other.StartAnimationListener("otherpile"); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. CaliforniaJackSaveInfo save = cons !.Resolve <CaliforniaJackSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think _deckGPile !.Init(_model.Deck1 !, ts.TagUsed); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _trick1 !.Init(_model.TrickArea1 !, ts.TagUsed); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. FlinchSaveInfo save = cons !.Resolve <FlinchSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _publicGraphics !.Init(_model.PublicPiles !); // i think _publicGraphics.StartAnimationListener("public"); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. FillOrBustSaveInfo save = cons !.Resolve <FillOrBustSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _diceControl !.LoadDiceViewModel(_model.Cup !); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. FourSuitRummySaveInfo save = cons !.Resolve <FourSuitRummySaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.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(); _tempG.Init(_model.TempSets, ts.TagUsed); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. YahtzeeHandsDownSaveInfo save = cons !.Resolve <YahtzeeHandsDownSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _combo1 !.LoadList(_model.ComboHandList !, "combo"); _chance1 !.Init(_model.ChancePile !, ""); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. SorryCardGameSaveInfo save = cons !.Resolve <SorryCardGameSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _otherPileXF !.Init(_model.OtherPile !, ""); _otherPileXF.StartAnimationListener("otherpile"); LoadBoard(); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. TeeItUpSaveInfo save = cons !.Resolve <TeeItUpSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _otherPile !.Init(_model.OtherPile !, ""); _otherPile.StartAnimationListener("otherpile"); CustomBasicList <TeeItUpPlayerItem> thisList; if (_gameContainer.BasicData !.MultiPlayer == true) { thisList = _gameContainer !.PlayerList !.GetAllPlayersStartingWithSelf(); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. MillebournesSaveInfo save = cons !.Resolve <MillebournesSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile2 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _newCard !.Init(_model.Pile1 !, ""); _disList.ForEach(thisD => thisD.Unregister()); _disList.Clear(); SetUpTeamPiles(); return(this.RefreshBindingsAsync(_aggregator)); }
Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message) { GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); FirstHookUp(); _yourChocolatePiles !.Init(_gameContainer !.SingleInfo !.ChocolatePiles !, ""); _yourStrawberryPiles !.Init(_gameContainer.SingleInfo.StrawberryPiles !, ""); _yourChocolatePiles.StartAnimationListener(EnumMilkType.Chocolate + _gameContainer.SingleInfo.NickName); _yourStrawberryPiles.StartAnimationListener(EnumMilkType.Strawberry + _gameContainer.SingleInfo.NickName); _opponentChocolatePiles !.Init(_otherPlayer !.ChocolatePiles !, ""); _opponentStrawberryPiles !.Init(_otherPlayer !.StrawberryPiles !, ""); _opponentChocolatePiles.StartAnimationListener(EnumMilkType.Chocolate + _otherPlayer.NickName); _opponentStrawberryPiles.StartAnimationListener(EnumMilkType.Strawberry + _otherPlayer.NickName); return(this.RefreshBindingsAsync(_aggregator)); }
public Rummy500MainView(IEventAggregator aggregator, TestOptions test, Rummy500VMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >(); _playerHandWPF.HorizontalOptions = LayoutOptions.Fill; _discardRummy = new BaseHandXF <RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard> >(); _mainG = new MainRummySetsXF <EnumSuitList, EnumColorList, RegularRummyCard, ts, DeckOfCardsXF <RegularRummyCard>, RummySet, SavedSet>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(Rummy500MainViewModel.RestoreScreen)); } Grid finalGrid = new Grid(); AddAutoColumns(finalGrid, 1); AddLeftOverColumn(finalGrid, 1); AddControlToGrid(finalGrid, mainStack, 0, 1); StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckGPile); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); 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(otherStack); mainStack.Children.Add(_playerHandWPF); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); Button button; button = GetGamingButton("Discard Current", nameof(Rummy500MainViewModel.DiscardCurrentAsync)); button.HorizontalOptions = LayoutOptions.Start; button.VerticalOptions = LayoutOptions.Start; otherStack.Children.Add(button); button = GetGamingButton("Create New Rummy Set", nameof(Rummy500MainViewModel.CreateSetAsync)); button.HorizontalOptions = LayoutOptions.Start; button.VerticalOptions = LayoutOptions.Start; otherStack.Children.Add(button); mainStack.Children.Add(otherStack); _mainG.Divider = 1.3; mainStack.Children.Add(_mainG); _discardRummy.Divider = 1.4; _discardRummy.ExtraControlSpace = 20; _discardRummy.HandType = HandObservable <RegularRummyCard> .EnumHandList.Vertical; _discardRummy.HorizontalOptions = LayoutOptions.Start; _discardRummy.VerticalOptions = LayoutOptions.FillAndExpand; AddControlToGrid(finalGrid, _discardRummy, 0, 0); _deckGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { mainStack.Children.Add(restoreP); //default add to grid but does not have to. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. Rummy500SaveInfo save = cons !.Resolve <Rummy500SaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ts.TagUsed); // i think _deckGPile !.Init(_model.Deck1 !, ts.TagUsed); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _mainG !.Init(_model.MainSets1 !, ts.TagUsed); Content = finalGrid; }
private readonly RackoUI _handWPF; //use this instead. public RackoMainView(IEventAggregator aggregator, TestOptions test, RackoVMData model, RackoGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _gameContainer = gameContainer; _deckGPile = new BaseDeckXF <RackoCardInformation, RackoGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <RackoCardInformation, RackoGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _currentWPF = new BasePileXF <RackoCardInformation, RackoGraphicsCP, CardGraphicsXF>(); _handWPF = new RackoUI(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(RackoMainViewModel.RestoreScreen)); } Grid finalGrid = new Grid(); AddAutoRows(finalGrid, 2); AddLeftOverColumn(finalGrid, 1); AddAutoColumns(finalGrid, 1); _score.AddColumn("Score Round", true, nameof(RackoPlayerItem.ScoreRound)); _score.AddColumn("Score Game", true, nameof(RackoPlayerItem.TotalScore)); int x; for (x = 1; x <= 10; x++) { _score.AddColumn("Section" + x, false, "Value" + x, nameof(RackoPlayerItem.CanShowValues));// 2 bindings. } SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(RackoMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(RackoMainViewModel.Status)); var stack = new StackLayout(); stack.Children.Add(_deckGPile); stack.Children.Add(_discardGPile); // can reposition or not even have as well. stack.Children.Add(_currentWPF); var thisBut = GetSmallerButton("Discard Current Card", nameof(RackoMainViewModel.DiscardCurrentAsync)); stack.Children.Add(thisBut); stack.Children.Add(firstInfo.GetContent); thisBut = GetSmallerButton("Racko", nameof(RackoMainViewModel.RackoAsync)); stack.Children.Add(thisBut); AddControlToGrid(finalGrid, stack, 0, 0); AddControlToGrid(finalGrid, _handWPF, 0, 1); // first column AddControlToGrid(finalGrid, _score, 1, 0); Grid.SetColumnSpan(_score, 2); _deckGPile.Margin = new Thickness(5, 5, 5, 5); _discardGPile.Margin = new Thickness(5, 5, 5, 5); if (restoreP != null) { stack.Children.Add(restoreP); //default add to grid but does not have to. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. RackoSaveInfo save = cons !.Resolve <RackoSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _currentWPF !.Init(_model.OtherPile !, ""); _currentWPF.StartAnimationListener("otherpile"); Content = finalGrid; }
public UnoMainView(IEventAggregator aggregator, TestOptions test, UnoVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <UnoCardInformation, UnoGraphicsCP, CardGraphicsXF>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(UnoMainViewModel.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. var endButton = GetGamingButton("End Turn", nameof(UnoMainViewModel.EndTurnAsync)); endButton.HorizontalOptions = LayoutOptions.Start; otherStack.Children.Add(endButton); ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(UnoMainViewModel.SayUnoScreen)); otherStack.Children.Add(parent); mainStack.Children.Add(otherStack); _score.AddColumn("Cards Left", true, nameof(UnoPlayerItem.ObjectCount)); //very common. _score.AddColumn("Total Points", true, nameof(UnoPlayerItem.TotalPoints), rightMargin: 10); _score.AddColumn("Previous Points", true, nameof(UnoPlayerItem.PreviousPoints), rightMargin: 10); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(UnoMainViewModel.NormalTurn)); firstInfo.AddRow("Next", nameof(UnoMainViewModel.NextPlayer)); firstInfo.AddRow("Status", nameof(UnoMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); mainStack.Children.Add(firstInfo.GetContent); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); otherStack.Children.Add(_score); //this is only a starting point. _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. } UnoSaveInfo save = cons !.Resolve <UnoSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.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(); Content = mainStack; }
public DutchBlitzMainView(IEventAggregator aggregator, TestOptions test, DutchBlitzVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <DutchBlitzCardInformation, DutchBlitzGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(DutchBlitzMainViewModel.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. mainStack.Children.Add(_public1); mainStack.Children.Add(otherStack); _score.AddColumn("Stock Left", false, nameof(DutchBlitzPlayerItem.StockLeft)); _score.AddColumn("Points Round", false, nameof(DutchBlitzPlayerItem.PointsRound)); _score.AddColumn("Points Game", false, nameof(DutchBlitzPlayerItem.PointsGame)); SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("Turn", nameof(DutchBlitzMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(DutchBlitzMainViewModel.Status)); firstInfo.AddRow("Error", nameof(DutchBlitzMainViewModel.ErrorMessage)); var button = GetGamingButton("Dutch", nameof(DutchBlitzMainViewModel.DutchAsync)); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_yourDiscard); otherStack.Children.Add(_yourStock); otherStack.Children.Add(button); mainStack.Children.Add(otherStack); 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. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. DutchBlitzSaveInfo save = cons !.Resolve <DutchBlitzSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _public1.Init(_model.PublicPiles1 !); _yourDiscard.Init(_model.DiscardPiles !, ""); _yourStock.Init(_model.StockPile !.StockFrame, ""); Content = mainStack; }
public SkipboMainView(IEventAggregator aggregator, TestOptions test, SkipboVMData model ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); _publicGraphics = new BasicMultiplePilesXF <SkipboCardInformation, SkipboGraphicsCP, CardGraphicsXF>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(SkipboMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_publicGraphics); mainStack.Children.Add(otherStack); _score.AddColumn("In Stock", false, nameof(SkipboPlayerItem.InStock)); int x; for (x = 1; x <= 4; x++) //has to change for flinch. { var thisStr = "Discard" + x; _score.AddColumn(thisStr, false, thisStr); } _score.AddColumn("Stock Left", false, nameof(SkipboPlayerItem.StockLeft)); _score.AddColumn("Cards Left", false, nameof(SkipboPlayerItem.ObjectCount)); //very common. SimpleLabelGridXF firstInfo = new SimpleLabelGridXF(); firstInfo.AddRow("RS Cards", nameof(SkipboMainViewModel.CardsToShuffle)); firstInfo.AddRow("Turn", nameof(SkipboMainViewModel.NormalTurn)); firstInfo.AddRow("Status", nameof(SkipboMainViewModel.Status)); mainStack.Children.Add(_playerHandWPF); ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(SkipboMainViewModel.PlayerPilesScreen)); mainStack.Children.Add(parent); 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. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. SkipboSaveInfo save = cons !.Resolve <SkipboSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _publicGraphics !.Init(_model.PublicPiles !, ""); // i think _publicGraphics.StartAnimationListener("public"); Content = mainStack; }
public BladesOfSteelMainView(IEventAggregator aggregator, TestOptions test, BladesOfSteelVMData model, BladesOfSteelGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _aggregator.Subscribe(this); _deckGPile = new BaseDeckXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _discardGPile = new BasePileXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _mainDefenseCards = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _opponentDefense = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _opponentAttack = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _yourDefense = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); _yourAttack = new BaseHandXF <RegularSimpleCard, ts, DeckOfCardsXF <RegularSimpleCard> >(); ScoringGuideXF tempScore = new ScoringGuideXF(); _score.AddColumn("Cards Left", true, nameof(BladesOfSteelPlayerItem.ObjectCount), rightMargin: 5); _score.AddColumn("Score", true, nameof(BladesOfSteelPlayerItem.Score), rightMargin: 5); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(BladesOfSteelMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(tempScore); otherStack.Children.Add(_score); mainStack.Children.Add(otherStack); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); StackLayout firstStack = new StackLayout(); 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 StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); AddControlToGrid(playerArea, otherStack, 0, 0); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); var endButton = GetGamingButton("End Turn", nameof(BladesOfSteelMainViewModel.EndTurnAsync)); endButton.HorizontalOptions = LayoutOptions.Start; endButton.VerticalOptions = LayoutOptions.Center; otherStack.Children.Add(endButton); var otherBut = GetGamingButton("Pass", nameof(BladesOfSteelMainViewModel.PassAsync)); otherStack.Children.Add(otherBut); otherBut.HorizontalOptions = LayoutOptions.Start; otherBut.VerticalOptions = LayoutOptions.Center; otherStack.Children.Add(_playerHandWPF); _deckGPile.HorizontalOptions = LayoutOptions.Start; _deckGPile.VerticalOptions = LayoutOptions.Start; _discardGPile.HorizontalOptions = LayoutOptions.Start; _discardGPile.VerticalOptions = LayoutOptions.Start; 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); _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 FluxxMainView(IEventAggregator aggregator, TestOptions test, FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer, FluxxGameContainer gameContainer ) { _aggregator = aggregator; _model = model; _gameContainer = gameContainer; _aggregator.Subscribe(this); _cardDetail1 = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.MainScreen); _cardDetail1.WidthRequest = 700; _deckGPile = new BaseDeckXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>(); _discardGPile = new BasePileXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>(); _score = new ScoreBoardXF(); _playerHandWPF = new BaseHandXF <FluxxCardInformation, FluxxGraphicsCP, CardGraphicsXF>(); StackLayout mainStack = new StackLayout(); ParentSingleUIContainer?restoreP = null; if (test.SaveOption == EnumTestSaveCategory.RestoreOnly) { restoreP = new ParentSingleUIContainer(nameof(FluxxMainViewModel.RestoreScreen)); } StackLayout otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; otherStack.Children.Add(_rule1); otherStack.Children.Add(_cardDetail1); otherStack.Children.Add(_goal1); mainStack.Children.Add(otherStack); //possibly forgot this. otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); var endButton = GetSmallerButton("End Turn", nameof(FluxxMainViewModel.EndTurnAsync)); otherStack.Children.Add(endButton); var button = GetSmallerButton("Discard", nameof(FluxxMainViewModel.DiscardAsync)); otherStack.Children.Add(button); ParentSingleUIContainer parent = new ParentSingleUIContainer(nameof(FluxxMainViewModel.PlayGiveScreen)) { HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Start }; otherStack.Children.Add(parent); button = GetSmallerButton("Unselect All", nameof(FluxxMainViewModel.UnselectHandCards)); otherStack.Children.Add(button); button = GetSmallerButton("Select All", nameof(FluxxMainViewModel.SelectHandCards)); otherStack.Children.Add(button); button = GetSmallerButton("Show Keepers", nameof(FluxxMainViewModel.ShowKeepersAsync)); otherStack.Children.Add(button); Grid tempGrid = new Grid(); AddLeftOverColumn(tempGrid, 75); AddAutoColumns(tempGrid, 1); TrueFalseConverter tConverter = new TrueFalseConverter(); tConverter.UseAbb = false; DetailGameInformationXF detail1 = new DetailGameInformationXF(); detail1.Margin = new Thickness(3, 3, 3, 3); { var withBlock = detail1; withBlock.AddRow("Plays Left", nameof(FluxxMainViewModel.PlaysLeft)); withBlock.AddRow("Hand Limit", nameof(FluxxMainViewModel.HandLimit)); withBlock.AddRow("Keeper Limit", nameof(FluxxMainViewModel.KeeperLimit)); withBlock.AddRow("Play Limit", nameof(FluxxMainViewModel.PlayLimit)); withBlock.AddRow("Another Turn", nameof(FluxxMainViewModel.AnotherTurn), tConverter); withBlock.AddRow("Current Turn", nameof(FluxxMainViewModel.NormalTurn)); withBlock.AddRow("Other Turn", nameof(FluxxMainViewModel.OtherTurn)); withBlock.AddRow("Status", nameof(FluxxMainViewModel.Status)); withBlock.AddRow("Draw Bonus", nameof(FluxxMainViewModel.DrawBonus)); withBlock.AddRow("Play Bonus", nameof(FluxxMainViewModel.PlayBonus)); withBlock.AddRow("Cards Drawn", nameof(FluxxMainViewModel.CardsDrawn)); withBlock.AddRow("Cards Played", nameof(FluxxMainViewModel.CardsPlayed)); withBlock.AddRow("Draw Rules", nameof(FluxxMainViewModel.DrawRules)); withBlock.AddRow("Previous" + Constants.vbCrLf + "Bonus", nameof(FluxxMainViewModel.PreviousBonus)); } mainStack.Children.Add(tempGrid); StackLayout finalStack = new StackLayout(); AddControlToGrid(tempGrid, detail1, 0, 1); AddControlToGrid(tempGrid, finalStack, 0, 0); otherStack = new StackLayout(); otherStack.Orientation = StackOrientation.Horizontal; mainStack.Children.Add(otherStack); //possibly forgot this. otherStack.Children.Add(_deckGPile); otherStack.Children.Add(_discardGPile); // can reposition or not even have as well. otherStack.Children.Add(_keeperHand1); finalStack.Children.Add(otherStack); _score.UseAbbreviationForTrueFalse = true; // this time has to be abbreviated _score.AddColumn("# In Hand", false, nameof(FluxxPlayerItem.ObjectCount)); _score.AddColumn("# Of Keepers", false, nameof(FluxxPlayerItem.NumberOfKeepers)); _score.AddColumn("Bread", false, nameof(FluxxPlayerItem.Bread), useTrueFalse: true); _score.AddColumn("Chocolate", false, nameof(FluxxPlayerItem.Chocolate), useTrueFalse: true); _score.AddColumn("Cookies", false, nameof(FluxxPlayerItem.Cookies), useTrueFalse: true); _score.AddColumn("Death", false, nameof(FluxxPlayerItem.Death), useTrueFalse: true); _score.AddColumn("Dreams", false, nameof(FluxxPlayerItem.Dreams), useTrueFalse: true); _score.AddColumn("Love", false, nameof(FluxxPlayerItem.Love), useTrueFalse: true); _score.AddColumn("Milk", false, nameof(FluxxPlayerItem.Milk), useTrueFalse: true); _score.AddColumn("Money", false, nameof(FluxxPlayerItem.Money), useTrueFalse: true); _score.AddColumn("Peace", false, nameof(FluxxPlayerItem.Peace), useTrueFalse: true); _score.AddColumn("Sleep", false, nameof(FluxxPlayerItem.Sleep), useTrueFalse: true); _score.AddColumn("Television", false, nameof(FluxxPlayerItem.Television), useTrueFalse: true); _score.AddColumn("The Brain", false, nameof(FluxxPlayerItem.TheBrain), useTrueFalse: true); _score.AddColumn("The Moon", false, nameof(FluxxPlayerItem.TheMoon), useTrueFalse: true); _score.AddColumn("The Rocket", false, nameof(FluxxPlayerItem.TheRocket), useTrueFalse: true); _score.AddColumn("The Sun", false, nameof(FluxxPlayerItem.TheSun), useTrueFalse: true); _score.AddColumn("The Toaster", false, nameof(FluxxPlayerItem.TheToaster), useTrueFalse: true); _score.AddColumn("Time", false, nameof(FluxxPlayerItem.Time), useTrueFalse: true); _score.AddColumn("War", false, nameof(FluxxPlayerItem.War), useTrueFalse: true); _playerHandWPF.Divider = 1.2; finalStack.Children.Add(_playerHandWPF); _keeperHand1.MinimumWidthRequest = 300; finalStack.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. } GamePackageViewModelBinder.ManuelElements.Clear(); //often times i have to add manually. FluxxSaveInfo save = cons !.Resolve <FluxxSaveInfo>(); //usually needs this part for multiplayer games. _score !.LoadLists(save.PlayerList); _playerHandWPF !.LoadList(_model.PlayerHand1 !, ""); // i think _discardGPile !.Init(_model.Pile1 !, ""); // may have to be here (well see) _discardGPile.StartListeningDiscardPile(); // its the main one. _deckGPile !.Init(_model.Deck1 !, ""); // try here. may have to do something else as well (?) _deckGPile.StartListeningMainDeck(); _rule1.LoadControls(_gameContainer); _goal1.LoadList(_model.Goal1 !, ""); _keeperHand1.LoadList(_model.Keeper1 !, ""); Content = mainStack; }