private T CreateInstance <T>(CardJson cj, string str) { var type = Type.GetType($"Furuyoni.Model.{str}", true); var args = new object[] { cj }; return((T)Activator.CreateInstance(type, args)); }
public Atack(CardJson cj) { Range = cj.Range; var damage = cj.Damage.Split('/'); AuraDamage = damage[0]; LifeDamage = damage[1]; }
public Card(CardJson cj) { Name = cj.Name; Owner = cj.Owner; Text = cj.Text; Category = CreateInstance <CardType>(cj, cj.Category); Main = CreateInstance <CardType>(cj, cj.Main); Sub = CreateInstance <CardType>(cj, cj.Sub); }
public class FullPower : CardType { public FullPower(CardJson _) { }
public class Reaction : CardType { public Reaction(CardJson _) { }
public class None : CardType { public None(CardJson _) { }
public class Unknown : CardType { public Unknown(CardJson _) { }
public Grant(CardJson cj) => Charge = cj.Charge;
public class Action : CardType { public Action(CardJson _) { }
public Special(CardJson cj) => Cost = cj.Cost;
public class TransForm : CardType { public TransForm(CardJson _) { }
public class Poison : CardType { public Poison(CardJson _) { }
public class Normal : CardType { public Normal(CardJson _) { }