using System.Collections; using System.Collections.Generic; using UnityEngine; public enum CardId { CrashingPunch, Cover } public class CardDatabase { private static Dictionary CARD_TO_HERO = new Dictionary() { {CardId.CrashingPunch, HeroId.Brute}, {CardId.Cover, HeroId.Brute}, }; public static BaseCard CreateCard(CardId id, BattleParticipant owner) { switch (id) { case CardId.CrashingPunch: return new CardCrashingPunch(owner); case CardId.Cover: return new CardCover(owner); default: throw new System.ArgumentException("CardId unknown", "id"); } } public static HeroId GetHeroIdOfCard(CardId id) { return CARD_TO_HERO[id]; } }