diff --git a/custom_json.cs b/custom_json.cs index 76c7897..a2f757a 100644 --- a/custom_json.cs +++ b/custom_json.cs @@ -37,4 +37,21 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ return jsonProperty; } } + + public class MonsterAttackConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + MonsterAttack attack = value as MonsterAttack; + throw new NotImplementedException(); + } + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + public override bool CanConvert(Type objectType) + { + return typeof(MonsterAttack).IsAssignableFrom(objectType); + } + } } diff --git a/json/hardcoded_mattack.json b/json/hardcoded_mattack.json index 878a9c9..66b5a5c 100644 --- a/json/hardcoded_mattack.json +++ b/json/hardcoded_mattack.json @@ -1,10 +1,10 @@ { - "NONE": - "EAT_CROP": - "EAT_FOOD": - "ANTQUEEN": - "CHECK_UP": - "ASSIST": + "NONE": "no attack chosen", + "EAT_CROP": "eats a furniture with the PLANT flag", + "EAT_FOOD": "eats a food item", + "ANTQUEEN": "lays ant eggs and feeds them to have them grow into an adult", + "CHECK_UP": "robot nurse checkup special", + "ASSIST": "self-aware special", "OPERATE": "PAID_BOT": "SHRIEK": diff --git a/mtype.cs b/mtype.cs index 0e7468d..819e87b 100644 --- a/mtype.cs +++ b/mtype.cs @@ -4,9 +4,15 @@ using System.Text; using System.Threading.Tasks; using System.ComponentModel; +using Newtonsoft.Json; namespace cdda_item_creator { + [JsonConverter(typeof(MonsterAttackConverter))] + class MonsterAttack + { + + } class Translation { [DefaultValue("")] @@ -54,7 +60,7 @@ public void Add(DamageUnit du_add) // intended to be able to be written to JSON easily class Mtype { - public const string Type = "MONSTER"; + public string Type { get; } = "MONSTER"; [DefaultValue("")] public string Id { get; set; } = ""; diff --git a/spell_type.cs b/spell_type.cs index 96b6a87..111fbee 100644 --- a/spell_type.cs +++ b/spell_type.cs @@ -142,7 +142,7 @@ public class spell_type public spell_type() { } public string Id { get; set; } = ""; - public const string Type = "SPELL"; + public string Type { get; } = "SPELL"; public string Name { get; set; } = ""; public string Description { get; set; } = "";