public override void PopulateFromJson(JObject jsonObject)
        {
            base.PopulateFromJson(jsonObject);
            m_randomly = Serialization.JsonTokenValue <bool>(jsonObject, "randomly", true);
            m_count    = DynamicValue.FromJsonProperty(jsonObject, "count");
            JArray val = Serialization.JsonArray(jsonObject, "discardSpellFilters");

            m_discardSpellFilters = new List <SpellFilter>((val != null) ? val.get_Count() : 0);
            if (val != null)
            {
                foreach (JToken item in val)
                {
                    m_discardSpellFilters.Add(SpellFilter.FromJsonToken(item));
                }
            }
            JArray val2 = Serialization.JsonArray(jsonObject, "drawSpellFilters");

            m_drawSpellFilters = new List <SpellFilter>((val2 != null) ? val2.get_Count() : 0);
            if (val2 != null)
            {
                foreach (JToken item2 in val2)
                {
                    m_drawSpellFilters.Add(SpellFilter.FromJsonToken(item2));
                }
            }
        }
Esempio n. 2
0
        public override void PopulateFromJson(JObject jsonObject)
        {
            base.PopulateFromJson(jsonObject);
            m_count = DynamicValue.FromJsonProperty(jsonObject, "count");
            JArray val = Serialization.JsonArray(jsonObject, "spellFilters");

            m_spellFilters = new List <SpellFilter>((val != null) ? val.get_Count() : 0);
            if (val != null)
            {
                foreach (JToken item in val)
                {
                    m_spellFilters.Add(SpellFilter.FromJsonToken(item));
                }
            }
        }
Esempio n. 3
0
        public static SpellFilter FromJsonProperty(JObject jsonObject, string propertyName, SpellFilter 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()));
        }