示例#1
0
    public static void Cache(JSONNode json)
    {
        var equipmentDesignation = new EquipmentDesignation(json);

        all[equipmentDesignation.Key] = equipmentDesignation;
        Debug.Log("Loaded equipment designation " + equipmentDesignation.Name);
    }
示例#2
0
    public EquipmentType(JSONNode json)
    {
        Key         = json["key"].Value;
        Name        = json["name"].Value;
        Designation = EquipmentDesignation.all[json["designation"].Value];

        StatMultipliers = new Dictionary <string, float>();
        var multipliers = json["stat_multipliers"].AsArray;

        foreach (JSONNode mult in multipliers)
        {
            string statKey = mult["key"].Value;
            float  val     = mult["multiplier"].AsFloat;
            StatMultipliers[statKey] = val;
        }

        SlotTypes = new Dictionary <string, SlotType>();
        var slotTypeArr = json["slots"].AsArray;

        foreach (JSONNode slotType in slotTypeArr)
        {
            var key = slotType.Value;
            SlotTypes.Add(key, SlotType.all[key]);
        }
    }
示例#3
0
    void ParseSingleConfig(JSONNode config)
    {
        var type = config["type"].Value;

        switch (type)
        {
        case Setting.type:
            JSONResource.Cache <Setting>(config);
            break;

        case SlotType.type:
            SlotType.Cache(config);
            break;

        case EquipmentDesignation.type:
            EquipmentDesignation.Cache(config);
            break;

        case EquipmentType.type:
            EquipmentType.Cache(config);
            break;

        case ConsumableTemplate.type:
            JSONResource.Cache <ConsumableTemplate>(config);
            break;

        case EnvironmentTemplate.type:
            JSONResource.Cache <EnvironmentTemplate>(config);
            break;

        case Environment.type:
            JSONResource.Cache <Environment>(config);
            break;

        case RoomTemplate.type:
            JSONResource.Cache <RoomTemplate>(config);
            break;

        case MobTemplate.type:
            JSONResource.Cache <MobTemplate>(config);
            break;

        case InteractionTemplate.type:
            JSONResource.Cache <InteractionTemplate>(config);
            break;

        case Rarity.type:
            Rarity.Cache(config);
            break;

        default:
            Debug.LogWarning(string.Format("Failed to load {0} {1}", config["type"], config["key"]));
            break;
        }
    }
示例#4
0
 public static void Cache(JSONNode json)
 {
     var equipmentDesignation = new EquipmentDesignation(json);
     all[equipmentDesignation.Key] = equipmentDesignation;
     Debug.Log("Loaded equipment designation " + equipmentDesignation.Name);
 }