Example #1
0
            public override void OnUndrawnFromSelection(ICard card)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int cardId = card.ID;
                anim.EndAllocManager.RemoveSelectionCard(cardId);
                anim.EndAllocManager.AddDeckCard(cardId);
                PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                a.EndState.Type = CardType.Unknown;
                a.EndState.Rank = CardRank.Unknown;
                a.EndState.Suit = CardSuit.Unknown;

                parent.EnqueueAnimation(anim);
            }
Example #2
0
            public override void OnPlayerPickedFromSelection(IPublicPlayerView player, ICard card)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int cardId = card.ID;
                int playerId = player.ID;
                anim.EndAllocManager.RemoveSelectionCard(cardId);
                anim.EndAllocManager.AddPlayerHandCard(playerId, cardId);
                PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                a.EndState.Type = card.Type;
                a.EndState.Rank = card.Rank;
                a.EndState.Suit = card.Suit;

                parent.EnqueueAnimation(anim);
            }
Example #3
0
            public override void OnPlayerStoleCard(IPublicPlayerView player, IPublicPlayerView targetPlayer, ICard targetCard)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int cardId = targetCard.ID;
                int playerId = player.ID;
                int targetPlayerId = targetPlayer.ID;
                anim.EndAllocManager.RemovePlayerHandCard(targetPlayerId, cardId);
                anim.EndAllocManager.RemovePlayerTableCard(targetPlayerId, cardId);
                anim.EndAllocManager.AddPlayerHandCard(playerId, cardId);
                PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                a.EndState.Type = targetCard.Type;
                a.EndState.Rank = targetCard.Rank;
                a.EndState.Suit = targetCard.Suit;

                parent.EnqueueAnimation(anim);
            }
Example #4
0
            public override void OnPlayerDrewFromGraveyard(IPublicPlayerView player, ReadOnlyCollection<ICard> drawnCards)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int playerId = player.ID;
                foreach(ICard card in drawnCards)
                {
                    int cardId = card.ID;
                    anim.StartAllocManager.InsertGraveyardCard(cardId);
                    anim.EndAllocManager.RemoveGraveyardCard(cardId);
                    anim.EndAllocManager.AddPlayerHandCard(playerId, cardId);
                    PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                    a.StartState.Type = a.EndState.Type = card.Type;
                    a.StartState.Rank = a.EndState.Rank = card.Rank;
                    a.StartState.Suit = a.EndState.Suit = card.Suit;
                }
                ICard graveyardTop = ConnectionManager.Game.GraveyardTop;
                anim.StartAllocManager.InsertGraveyardCard(graveyardTop.ID);
                anim.EndAllocManager.InsertGraveyardCard(graveyardTop.ID);
                PlayingCardAnimator g = anim.GetPlayingCardAnimator(graveyardTop.ID);
                g.StartState.Type = g.EndState.Type = graveyardTop.Type;
                g.StartState.Rank = g.EndState.Rank = graveyardTop.Rank;
                g.StartState.Suit = g.EndState.Suit = graveyardTop.Suit;

                parent.EnqueueAnimation(anim);
            }
Example #5
0
            public override void OnPlayerDrewFromDeck(IPublicPlayerView player, ReadOnlyCollection<ICard> drawnCards)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int playerId = player.ID;
                foreach(ICard card in drawnCards.Reverse())
                {
                    int cardId = card.ID;
                    anim.StartAllocManager.AddDeckCard(cardId);
                    anim.EndAllocManager.AddPlayerHandCard(playerId, cardId);
                    PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                    a.StartState.Type = CardType.Unknown;
                    a.StartState.Rank = CardRank.Unknown;
                    a.StartState.Suit = CardSuit.Unknown;
                    a.EndState.Type = card.Type;
                    a.EndState.Rank = card.Rank;
                    a.EndState.Suit = card.Suit;
                }

                parent.EnqueueAnimation(anim);
            }
Example #6
0
            public override void OnJoinedGame(ISpectatorControl control)
            {
                Gdk.Threads.Enter();
                parent.Update();
                Gdk.Threads.Leave();

                Animation anim = new Animation(parent);

                IGame game = control.Game;
                foreach(IPublicPlayerView player in game.Players)
                {
                    int playerId = player.ID;
                    anim.EndAllocManager.SetPlayerLifepoints(playerId, player.LifePoints);
                    anim.GetPlayerCharacterAnimator(playerId).EndState.Type = player.CharacterType;
                    anim.GetPlayerRoleAnimator(playerId).EndState.Role = player.Role;
                    foreach(ICard card in player.Hand)
                    {
                        int cardId = card.ID;
                        anim.EndAllocManager.AddPlayerHandCard(playerId, cardId);
                        PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                        a.EndState.Type = card.Type;
                        a.EndState.Rank = card.Rank;
                        a.EndState.Suit = card.Suit;
                    }
                    foreach(ICard card in player.Table)
                    {
                        int cardId = card.ID;
                        anim.EndAllocManager.AddPlayerTableCard(playerId, cardId);
                        PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                        a.EndState.Type = card.Type;
                        a.EndState.Rank = card.Rank;
                        a.EndState.Suit = card.Suit;
                    }
                }
                ICard graveyardTop = game.GraveyardTop;
                if(graveyardTop != null)
                {
                    int cardId = graveyardTop.ID;
                    anim.EndAllocManager.AddGraveyardCard(cardId);
                    PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                    a.EndState.Type = graveyardTop.Type;
                    a.EndState.Rank = graveyardTop.Rank;
                    a.EndState.Suit = graveyardTop.Suit;
                }

                parent.EnqueueAnimation(anim);
            }
Example #7
0
            public override void OnDrawnIntoSelection(ReadOnlyCollection<ICard> drawnCards)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                foreach(ICard card in drawnCards.Reverse())
                {
                    int cardId = card.ID;
                    anim.StartAllocManager.AddDeckCard(cardId);
                    anim.EndAllocManager.AddSelectionCard(cardId);
                    PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                    a.StartState.Type = CardType.Unknown;
                    a.StartState.Rank = CardRank.Unknown;
                    a.StartState.Suit = CardSuit.Unknown;
                    a.EndState.Type = card.Type;
                    a.EndState.Rank = card.Rank;
                    a.EndState.Suit = card.Suit;
                }

                parent.EnqueueAnimation(anim);
            }
Example #8
0
            public override void OnDeckChecked(ICard card)
            {
                Animation anim = new Animation(parent, parent.lastAnim);

                int cardId = card.ID;
                anim.StartAllocManager.AddDeckCard(cardId);
                anim.EndAllocManager.AddGraveyardCard(cardId);
                PlayingCardAnimator a = anim.GetPlayingCardAnimator(cardId);
                a.EndState.Type = card.Type;
                a.EndState.Rank = card.Rank;
                a.EndState.Suit = card.Suit;

                parent.EnqueueAnimation(anim);
            }