Exemplo n.º 1
0
        public DeckModel CreateDeck(string name, string heroId)
        {
            var heroCard = _cardCache.GetById <ICard>(heroId);

            if (name == null || heroCard == null)
            {
                return(null);
            }

            var deck = new Deck
            {
                Name        = name,
                HeroCardId  = heroId,
                PlayerClass = heroCard.PlayerClass
            };

            _decks.Add(deck);
            SaveDecks();

            return(BuildDeckModel(deck));
        }
Exemplo n.º 2
0
        public CardModel FindById(string id)
        {
            ICard card = _cardCache.GetById <ICard>(id);

            return(Mapper.Map <ICard, CardModel>(card));
        }