Ejemplo n.º 1
0
        // todo may want to add logging to these
        /// <summary>
        /// Inserts the card into the player's appropriate hand
        /// </summary>
        /// <param name="toPlayer">The player to give the cards to.</param>
        /// <param name="card">The card to give them.</param>
        /// <param name="fromPlayer">The player who is giving the card (if applicable)</param>
        public void GiveCardToPlayer(Player toPlayer, BaseCard card, Player fromPlayer = null)
        {
            switch (card.CardType)
            {
                case CardType.Skill:
                    toPlayer.Cards.Add((SkillCard)card);
                    break;
                case CardType.Quorum:
                    toPlayer.QuorumHand.Add((QuorumCard)card);
                    break;
                case CardType.Loyalty:
                    toPlayer.LoyaltyCards.Add((LoyaltyCard)card);
                    break;
                case CardType.SuperCrisis:
                    toPlayer.SuperCrisisCards.Add((SuperCrisisCard)card);
                    break;
                case CardType.Mutiny:
                    toPlayer.MutinyHand.Add((MutinyCard)card);
                    break;
            }

            if (fromPlayer != null)
                fromPlayer.Discard(card);
        }
Ejemplo n.º 2
0
 public void DiscardCard(BaseCard card, Player player = null)
 {  
     // discards the passed card into its appropriate deck
     switch (card.CardType)
     {
         case CardType.Quorum:
             CurrentGameState.QuorumDeck.Discard((QuorumCard)card);
             break;
         case CardType.Skill:
             var skillCard = (SkillCard) card;
             switch (skillCard.CardColor)
             {
                 case SkillCardColor.Politics:
                     CurrentGameState.PoliticsDeck.Discard(skillCard);
                     break;
                 case SkillCardColor.Leadership:
                     CurrentGameState.LeadershipDeck.Discard(skillCard);
                     break;
                 case SkillCardColor.Tactics:
                     CurrentGameState.TacticsDeck.Discard(skillCard);
                     break;
                 case SkillCardColor.Engineering:
                     CurrentGameState.EngineeringDeck.Discard(skillCard);
                     break;
                 case SkillCardColor.Piloting:
                     CurrentGameState.PilotingDeck.Discard(skillCard);
                     break;
                 case SkillCardColor.Treachery:
                     CurrentGameState.TreacheryDeck.Discard(skillCard);
                     break;
             }
             break;
         case CardType.SuperCrisis:
             CurrentGameState.SuperCrisisDeck.Discard((SuperCrisisCard) card);
             break;
         case CardType.Loyalty:
             CurrentGameState.LoyaltyDeck.Discard((LoyaltyCard) card);
             break;
     }
     if (player != null)
         player.Discard(card);
 }