using System.Collections; using System.Collections.Generic; using UnityEngine; public enum HCardId { CrashingPunch, Cover, LightningStrike, Scarring, Thunderstorm, BlindFury, Crush, Meditate, Earthquake, LightningHatchet, InnerStrength, Fireworks, MolotovCocktail, Fracking, CanisterBomb, IronskinDraught, SwordSlash, ShieldBlock, LeadShot, SmokeBomb, Eagerness, OilOfSharpness, } public class HeroCardDatabase : CardDatabase { private System.Type GetCardClass(HCardId id) { switch (id) { case HCardId.CrashingPunch: return typeof(CrashingPunchHCard); case HCardId.Cover: return typeof(CoverHCard); case HCardId.LightningStrike: return typeof(LightningStrikeHCard); case HCardId.Scarring: return typeof(ScarringHCard); case HCardId.Thunderstorm: return typeof(ThunderstormHCard); case HCardId.BlindFury: return typeof(BlindFuryHCard); case HCardId.Meditate: return typeof(MeditateHCard); case HCardId.LightningHatchet: return typeof(LightningHatchetHCard); case HCardId.MolotovCocktail: return typeof(MolotovCocktailHCard); case HCardId.IronskinDraught: return typeof(IronskinDraughtHCard); case HCardId.SwordSlash: return typeof(SwordSlashHCard); case HCardId.ShieldBlock: return typeof(ShieldBlockHCard); case HCardId.LeadShot: return typeof(LeadShotHCard); case HCardId.SmokeBomb: return typeof(SmokeBombHCard); case HCardId.Eagerness: return typeof(EagernessHCard); case HCardId.OilOfSharpness: return typeof(OilOfSharpnessHCard); default: throw new System.ArgumentException("HCardId unknown", "id"); } } public override HeroCard CreateCard(int id, BattleParticipant owner) { HCardId heroCardId = (HCardId) id; System.Type cardClass = GetCardClass(heroCardId); return (HeroCard) System.Activator.CreateInstance(cardClass, owner); } }