Ejemplo n.º 1
0
    public TempSettingsInt GetInt(string id, int defaultValue)
    {
        TempSettingsInt settingsInt;

        settingsInts.TryGetValue(id, out settingsInt);
        if (settingsInt == null)
        {
            settingsInt       = new TempSettingsInt(id);
            settingsInt.value = defaultValue;
            settingsInts[id]  = settingsInt;
        }
        return(settingsInt);
    }
Ejemplo n.º 2
0
    private void ValuesUnserialize(SValue state)
    {
        SValue sList = state["values"];

        foreach (SValue hash in sList.List)
        {
            string          id = hash["id"].String;
            TempSettingsInt settingsInt;
            settingsInts.TryGetValue(id, out settingsInt);
            if (settingsInt == null)
            {
                settingsInt      = new TempSettingsInt(id);
                settingsInts[id] = settingsInt;
            }
            settingsInt.priority = hash["priority"].Int;
            settingsInt.value    = hash["value"].Int;
            settingsInts[id]     = settingsInt;
        }
    }
Ejemplo n.º 3
0
 private static int CompareSettingsInts(TempSettingsInt value0, TempSettingsInt value1)
 {
     return(value1.priority - value0.priority);
 }