private void SetUpTeamPiles()
 {
     _mainGame !.SingleInfo = _gameContainer.PlayerList !.GetSelf();
     if (_gameContainer.SingleInfo !.MainHandList.Any(items => items.CompleteCategory == EnumCompleteCategories.None))
     {
         throw new BasicBlankException("Cannot have category of none.  Rethink");
     }
     _pileStack !.Children.Clear();
     _gameContainer.TeamList.ForEach(thisTeam =>
     {
         Grid tempGrid   = new Grid();
         tempGrid.Margin = new Thickness(0, 0, 0, 20);
         AddAutoRows(tempGrid, 2);
         AddAutoColumns(tempGrid, 2);
         TextBlock ThisLabel  = new TextBlock();
         ThisLabel.Text       = thisTeam.Text;
         ThisLabel.Foreground = Brushes.Aqua;
         ThisLabel.FontWeight = FontWeights.Bold;
         AddControlToGrid(tempGrid, ThisLabel, 0, 0);
         Grid.SetColumnSpan(ThisLabel, 2);
         ThisLabel.HorizontalAlignment = HorizontalAlignment.Center; // try this
         BasicMultiplePilesWPF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsWPF> thisDis = new BasicMultiplePilesWPF <MillebournesCardInformation, MillebournesGraphicsCP, CardGraphicsWPF>();
         thisDis.Init(thisTeam.CardPiles, "");
         thisDis.StartAnimationListener("team" + thisTeam.TeamNumber);
         AddControlToGrid(tempGrid, thisDis, 1, 0);
         SafetiesWPF thisS = new SafetiesWPF();
         thisS.Init(thisTeam, _mainGame, _gameContainer.Command);
         _disList.Add(thisDis);
         AddControlToGrid(tempGrid, thisS, 1, 1);
         _pileStack.Children.Add(tempGrid);
     });
 }
        Task IHandleAsync <LoadEventModel> .HandleAsync(LoadEventModel message)
        {
            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");
            return(this.RefreshBindingsAsync(_aggregator));
        }
Beispiel #3
0
        public PlayerPilesView(FlinchVMData model, FlinchGameContainer gameContainer, IEventAggregator aggregator)
        {
            StackPanel stack = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };
            var player = gameContainer.PlayerList !.GetWhoPlayer();

            _discardGraphics = new BasicMultiplePilesWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>();
            _discardGraphics.Init(model.DiscardPiles !, "");
            _discardGraphics.StartAnimationListener("discard" + player.NickName);
            stack.Children.Add(_discardGraphics);
            _stockGraphics = new BasicMultiplePilesWPF <FlinchCardInformation, FlinchGraphicsCP, CardGraphicsWPF>();
            _stockGraphics.Init(model.StockPile !.StockFrame, ""); // i think
            _stockGraphics.StartAnimationListener("stock" + player.NickName);
            stack.Children.Add(_stockGraphics);
            _aggregator = aggregator;
            Content     = stack;
        }
Beispiel #4
0
        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));
        }