コード例 #1
0
 protected virtual void handleMonsterFor(MainDeckDTO mainDeckDto, Card card, string lowerCardType)
 {
     handleNonExtraPendulumNormalMonster(mainDeckDto, card, lowerCardType);
     handleNonExtraPendulumEffectMonster(mainDeckDto, card, lowerCardType);
     handleRitualMonster(mainDeckDto, card, lowerCardType);
     handleEffectMonster(mainDeckDto, card, lowerCardType);
     handleNormalMonster(mainDeckDto, card, lowerCardType);
 }
コード例 #2
0
        /// <inheritdoc />
        public MainDeckDTO CreateMainDeckDto(Decklist decklist)
        {
            var mainDeckDto = new MainDeckDTO();

            foreach (var card in decklist.MainDeck)
            {
                var lowerCardType = card.Type.ToLower();
                if (lowerCardType.Contains("monster"))
                {
                    handleMonsterFor(mainDeckDto, card, lowerCardType);
                }
                else
                {
                    handleTraps(mainDeckDto, card, lowerCardType);
                    handleSpells(mainDeckDto, card, lowerCardType);
                }
            }

            return(mainDeckDto);
        }