public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_precomputedData      = PrecomputedData.FromJsonProperty(jsonObject, "precomputedData");
     m_families             = Serialization.JsonArrayAsList <Family>(jsonObject, "families");
     m_effectAreaDefinition = IAreaDefinitionUtils.FromJsonProperty(jsonObject, "effectAreaDefinition");
 }
Пример #2
0
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_precomputedData    = PrecomputedData.FromJsonProperty(jsonObject, "precomputedData");
     m_families           = Serialization.JsonArrayAsList <Family>(jsonObject, "families");
     m_life               = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "life");
     m_movementPoints     = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "movementPoints");
     m_actionValue        = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "actionValue");
     m_customActionTarget = IEntitySelectorUtils.FromJsonProperty(jsonObject, "customActionTarget");
     m_actionType         = (ActionType)Serialization.JsonTokenValue <int>(jsonObject, "actionType", 0);
     m_actionRange        = ActionRange.FromJsonProperty(jsonObject, "actionRange");
     m_aiArchetype        = (AIArchetype)Serialization.JsonTokenValue <int>(jsonObject, "aiArchetype", 0);
 }
Пример #3
0
        public static PrecomputedData 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);
            PrecomputedData precomputedData = new PrecomputedData();

            precomputedData.PopulateFromJson(jsonObject);
            return(precomputedData);
        }
Пример #4
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));
                }
            }
        }
Пример #5
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));
                }
            }
        }
Пример #6
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");
 }
Пример #7
0
        public static PrecomputedData FromJsonProperty(JObject jsonObject, string propertyName, PrecomputedData 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()));
        }