Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
        public static ActionRange 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);
            ActionRange actionRange = new ActionRange();

            actionRange.PopulateFromJson(jsonObject);
            return(actionRange);
        }
Ejemplo n.º 3
0
        public static ActionRange FromJsonProperty(JObject jsonObject, string propertyName, ActionRange 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()));
        }