public void SetGameSetting(string gameName, string gameSetting, string gameValue) { var key = SettingKey(gameName, gameSetting); if (GameSettings.ContainsKey(key)) { GameSettings[key] = gameValue; } else { GameSettings.Add(key, gameValue); } }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var dictionary = serializer.Deserialize <Dictionary <string, object> >(reader); GameSettings settings = new GameSettings(); foreach (var kv in dictionary) { settings.Add(kv.Key, kv.Value); } return(settings); }