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)); }
public CardModel FindById(string id) { ICard card = _cardCache.GetById <ICard>(id); return(Mapper.Map <ICard, CardModel>(card)); }