public Spell(string name = "", int level = 0, string castingTime = "", string range = "", string components = "", string duration = "", AttackType attackType = default, DamageAndEffectType damageAndEffectType = default, SchoolOfMagic schoolOfMagic = default, string description = "", string additionalInfo = "", List <string> listOfClassesSpellIsIn = null, List <string> spellTags = null) { AccessorName = CreateAccessorName(name); Name = name; Level = Math.Clamp(level, 0, 9); CastingTime = castingTime; Range = range; Components = components; Duration = duration; AttackType = attackType; DamageAndEffectType = damageAndEffectType; SchoolOfMagic = schoolOfMagic; Description = description; AdditionalInfo = additionalInfo; ListOfClassesSpellIsIn = listOfClassesSpellIsIn ?? new List <string>(); SpellTags = spellTags ?? new List <string>(); }
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { DamageAndEffectType attackAndEffectType = (DamageAndEffectType)value; writer.WriteValue(attackAndEffectType.ToString()); }