Exemplo n.º 1
0
        public override void PopulateFromJson(JObject jsonObject)
        {
            this.PopulateFromJson(jsonObject);
            m_god             = (God)Serialization.JsonTokenValue <int>(jsonObject, "god", 0);
            m_precomputedData = PrecomputedData.FromJsonProperty(jsonObject, "precomputedData");
            m_defaultWeapon   = Serialization.JsonTokenIdValue <WeaponDefinition>(jsonObject, "defaultWeapon");
            JArray val = Serialization.JsonArray(jsonObject, "heroEffects");

            m_heroEffects = new List <AbstractEffectDefinition>((val != null) ? val.get_Count() : 0);
            if (val != null)
            {
                foreach (JToken item in val)
                {
                    m_heroEffects.Add(AbstractEffectDefinition.FromJsonToken(item));
                }
            }
        }
        public static AbstractEffectDefinition FromJsonProperty(JObject jsonObject, string propertyName, AbstractEffectDefinition defaultValue = null)
        {
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Invalid comparison between Unknown and I4
            JProperty val = jsonObject.Property(propertyName);

            if (val == null || (int)val.get_Value().get_Type() == 10)
            {
                return(defaultValue);
            }
            return(FromJsonToken(val.get_Value()));
        }