コード例 #1
0
ファイル: GameManager.cs プロジェクト: MaxPeck/DeckManager
        public BaseCard DrawCard(BaseCard card, Player player = null)
        {
            // todo each discard creates new gamestate? that would let us implement undos
            // discards the passed card into its appropriate deck
            BaseCard ret = new SkillCard();
            switch (card.CardType)
            {
                case CardType.Crisis:
                    ret = CurrentGameState.CrisisDeck.Draw();
                    break;
                case CardType.Quorum:
                    ret = CurrentGameState.QuorumDeck.Draw();
                    break;
                case CardType.Skill:
                    var skillCard = (SkillCard)card;
                    switch (skillCard.CardColor)
                    {
                        case SkillCardColor.Politics:
                            ret = CurrentGameState.PoliticsDeck.Draw();
                            break;
                        case SkillCardColor.Leadership:
                            ret = CurrentGameState.LeadershipDeck.Draw();
                            break;
                        case SkillCardColor.Tactics:
                            ret = CurrentGameState.TacticsDeck.Draw();
                            break;
                        case SkillCardColor.Engineering:
                            ret = CurrentGameState.EngineeringDeck.Draw();
                            break;
                        case SkillCardColor.Piloting:
                            ret = CurrentGameState.PilotingDeck.Draw();
                            break;
                        case SkillCardColor.Treachery:
                            ret = CurrentGameState.TreacheryDeck.Draw();
                            break;
                    }
                    break;
                case CardType.SuperCrisis:
                    ret = CurrentGameState.SuperCrisisDeck.Draw();
                    break;
                case CardType.Loyalty:
                    ret = CurrentGameState.LoyaltyDeck.Draw();
                    break;
            }
            if (player != null)
                player.TakeCard(ret);

            return ret;
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: MaxPeck/DeckManager
        public IEnumerable<SkillCard> DrawSkillCards(SkillCardColor color, int count, Player player = null)
        {
            List<SkillCard> ret;
            switch (color)
            {
                case SkillCardColor.Engineering:
                    ret = CurrentGameState.EngineeringDeck.DrawMany(count).ToList();
                    break;
                case SkillCardColor.Leadership:
                    ret = CurrentGameState.LeadershipDeck.DrawMany(count).ToList();
                    break;
                case SkillCardColor.Piloting:
                    ret = CurrentGameState.PilotingDeck.DrawMany(count).ToList();
                    break;
                case SkillCardColor.Politics:
                    ret = CurrentGameState.PoliticsDeck.DrawMany(count).ToList();
                    break;
                case SkillCardColor.Tactics:
                    ret = CurrentGameState.TacticsDeck.DrawMany(count).ToList();
                    break;
                case SkillCardColor.Treachery:
                    ret = CurrentGameState.TreacheryDeck.DrawMany(count).ToList();
                    break;
                default:
                    return new List<SkillCard>();
            }

            if (player != null)
                player.TakeCard(ret);
            return ret;
        }