public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            DamageInstance instance = (DamageInstance)value;
            JToken         token    = JToken.FromObject(instance.Values, serializer);

            token.WriteTo(writer);
        }
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            JToken         token    = JToken.Load(reader);
            DamageInstance instance = new DamageInstance {
            };

            if (token.Type == JTokenType.Array)
            {
                foreach (JObject jo in token.ToObject <List <JObject> >(serializer))
                {
                    DamageUnit du = (DamageUnit)jo.ToObject(typeof(DamageUnit), serializer);
                    instance.Add(du);
                }
            }
            else
            {
                return(token.ToObject <T>(serializer));
            }
            return(instance);
        }