using System.Collections; using System.Collections.Generic; using UnityEngine; public enum CardId { CrashingPunch, Cover, LightningStrike, Scarring, Thunderstorm, } public class HeroCardDatabase : CardDatabase { private static Dictionary CARD_TO_HERO = new Dictionary() { {CardId.CrashingPunch, HeroId.Brute}, {CardId.Cover, HeroId.Brute}, {CardId.LightningStrike, HeroId.Shaman}, {CardId.Scarring, HeroId.Brute}, {CardId.Thunderstorm, HeroId.Shaman}, }; public override HeroCard CreateCard(int id, BattleParticipant owner) { CardId heroCardId = (CardId) id; switch (heroCardId) { case CardId.CrashingPunch: return new CardCrashingPunch(owner); case CardId.Cover: return new CardCover(owner); case CardId.LightningStrike: return new CardLightningStrike(owner); case CardId.Scarring: return new CardScarring(owner); case CardId.Thunderstorm: return new CardThunderstorm(owner); default: throw new System.ArgumentException("CardId unknown", "id"); } } public static HeroId GetHeroIdOfCard(CardId id) { return CARD_TO_HERO[id]; } }