예제 #1
0
        public void SaveLocalSettings(GameSettings settings)
        {
            IPreferencesService prf = new PreferencesService();

            prf.SavePreference(key1, settings.PlayerName);
            prf.SavePreference(key2, settings.LessSound.ToString());
        }
예제 #2
0
        //public static int MaxLevelIndicator
        //{ get { return 100; } }

        //public static int MinLevelIndicator
        //{ get { return 0; } }

        public GameSettings LoadLocalSettings()
        {
            var settings = new GameSettings(_canvasSize);

            IPreferencesService prf = new PreferencesService();
            string playerName       = prf.LoadPreference(key1);

            if (string.IsNullOrEmpty(playerName))
            {
                settings.PlayerName = "Dr. Who";
            }
            else
            {
                settings.PlayerName = playerName;
            }

            string lessSound = prf.LoadPreference(key2);

            bool.TryParse(lessSound, out bool less);

            settings.LessSound = less;

            return(settings);
        }