Ejemplo n.º 1
0
        public void SaveSettings()
        {
            string       path     = Defines.SYSTEM_SETTINGS_DIRECTORY;
            GameSettings instance = GameSettings.Instance;
            BinaryWriter writer   = new BinaryWriter(File.Create(path + ".tmp"));

            ResolutionData resolution = instance.Resolution;

            writer.Write(resolution.Width);
            writer.Write(resolution.Height);
            writer.Write(resolution.Fullscreen);
            writer.Write((int)instance.Shadows);
            writer.Write((int)instance.ParticleDetail);
            writer.Write(instance.MultiSamplingEnabled);

            writer.Write(instance.AmbienceVolume);
            writer.Write(instance.EffectsVolume);
            writer.Write(instance.MusicVolume);
            writer.Write(instance.VoiceVolume);

            writer.Flush();
            writer.Close();

            if (File.Exists(path + ".sav"))
            {
                File.Delete(path + ".sav");
            }

            File.Move(path + ".tmp", path + ".sav");
        }
Ejemplo n.º 2
0
        public bool CompareTo(ResolutionData compare)
        {
            if (Width != compare.Width)
            {
                return(false);
            }

            if (Height != compare.Width)
            {
                return(false);
            }

            if (Fullscreen != compare.Fullscreen)
            {
                return(false);
            }

            return(true);
        }