예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
        }