예제 #1
0
        public static GaugeValue FromJsonToken(JToken token)
        {
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0007: Invalid comparison between Unknown and I4
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            if ((int)token.get_Type() != 1)
            {
                Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found"));
                return(null);
            }
            JObject    jsonObject = Extensions.Value <JObject>((IEnumerable <JToken>)token);
            GaugeValue gaugeValue = new GaugeValue();

            gaugeValue.PopulateFromJson(jsonObject);
            return(gaugeValue);
        }
예제 #2
0
        public override void PopulateFromJson(JObject jsonObject)
        {
            this.PopulateFromJson(jsonObject);
            m_eventsInvalidatingCost    = Serialization.JsonArrayAsList <EventCategory>(jsonObject, "eventsInvalidatingCost");
            m_eventsInvalidatingCasting = Serialization.JsonArrayAsList <EventCategory>(jsonObject, "eventsInvalidatingCasting");
            m_precomputedData           = PrecomputedData.FromJsonProperty(jsonObject, "precomputedData");
            m_spellType = (SpellType)Serialization.JsonTokenValue <int>(jsonObject, "spellType", 1);
            m_god       = (God)Serialization.JsonTokenValue <int>(jsonObject, "god", 0);
            m_element   = (Element)Serialization.JsonTokenValue <int>(jsonObject, "element", 0);
            m_tags      = Serialization.JsonArrayAsList <SpellTag>(jsonObject, "tags");
            JArray val = Serialization.JsonArray(jsonObject, "gaugeToModifyOnSpellPlay");

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

            m_costs = new List <Cost>((val2 != null) ? val2.get_Count() : 0);
            if (val2 != null)
            {
                foreach (JToken item2 in val2)
                {
                    m_costs.Add(Cost.FromJsonToken(item2));
                }
            }
            m_castTarget = ICastTargetDefinitionUtils.FromJsonProperty(jsonObject, "castTarget");
            JArray val3 = Serialization.JsonArray(jsonObject, "spellEffectData");

            m_spellEffectData = new List <SpellEffectInstantiationData>((val3 != null) ? val3.get_Count() : 0);
            if (val3 != null)
            {
                foreach (JToken item3 in val3)
                {
                    m_spellEffectData.Add(SpellEffectInstantiationData.FromJsonToken(item3));
                }
            }
        }
예제 #3
0
        public static GaugeValue FromJsonProperty(JObject jsonObject, string propertyName, GaugeValue 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()));
        }