Ejemplo n.º 1
0
        public static bool BuildCommanderDeck(string deckName, string tribeType)
        {
            var deck = DeckRepository.GetDeck(deckName);

            if (deck.Commander == null)
            {
                return(false);
            }

            var legalCards = CardRepository.GetAllCommanderLegalCardInGivenColors(CardBLL.GetCardColors(CardMapper.Map(deck.Commander)));
            var tempCards  = legalCards.Where(c => c.SubTypes.Contains(tribeType) || c.RulesText.Contains(tribeType) && c.Id != deck.Commander.Id);

            if (tempCards.Count() > 34)
            {
                tempCards = tempCards.ToList().GetRange(0, 34);
            }



            DeckRepository.UpdateDeck(deck);

            return(true);
        }