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); }
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; } }
private static int CompareSettingsInts(TempSettingsInt value0, TempSettingsInt value1) { return(value1.priority - value0.priority); }