Settings ClassDelta Engine Documentation
Keeps a bunch of settings like the resolution, which are used when the application starts up. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Core Settings
    DeltaEngine.Mocks MockSettings
    DeltaEngine.Platforms FileSettings

Namespace: DeltaEngine.Core
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract class Settings : IDisposable

The Settings type exposes the following members.

Constructors

  NameDescription
Protected methodSettings
Initializes a new instance of the Settings class
Top
Methods

  NameDescription
Public methodDispose
Public methodStatic memberGetMyDocumentsAppFolder
Public methodGetValue T 
Public methodLoadDefaultSettings
Public methodSave
Public methodSetValue
Top
Fields

  NameDescription
Public fieldStatic memberDefaultUpdatesPerSecond
Protected fieldStatic memberSettingsFilename
Protected fieldwasChanged
Top
Properties

  NameDescription
Public propertyAntiAliasingSamples
4 works on most frameworks, but some have AA disabled, use 0 to keep all frameworks in sync View code on GitHub
Public propertyColorBufferBits
Public propertyStatic memberCurrent
Public propertyCustomSettingsExists
Public propertyStatic memberDefaultResolution
Public propertyDepthBufferBits
Public propertyLimitFramerate
Public propertyMusicVolume
Public propertyOnlineServiceIp
Public propertyOnlineServicePort
Public propertyPlayerName
Public propertyProfilingModes
Public propertyRapidUpdatesPerSecond
Public propertyResolution
Public propertySoundVolume
Public propertyStartInFullscreen
Public propertyTwoLetterLanguageName
Public propertyUpdatesPerSecond
Public propertyUseOnlineLogging
Public propertyUseVSync
Top
Remarks

Tests: DeltaEngine.Tests.Core.SettingsTests
Examples

6 unit tests call DeltaEngine.Core.Settings
[Test]
public void CheckDefaultSettings()
{
    Settings settings = Settings.Current;
    settings.LoadDefaultSettings();
    Assert.AreEqual(Settings.DefaultResolution, settings.Resolution);
    Assert.AreEqual(false, settings.StartInFullscreen);
    Assert.AreEqual(1.0f, settings.SoundVolume);
    Assert.AreEqual(0.75f, settings.MusicVolume);
    Assert.AreEqual(24, settings.DepthBufferBits);
    Assert.AreEqual(32, settings.ColorBufferBits);
    Assert.AreEqual(0, settings.AntiAliasingSamples);
    Assert.AreEqual(0, settings.LimitFramerate);
    Assert.AreEqual(false, settings.UseVSync);
    Assert.AreEqual(20, settings.UpdatesPerSecond);
    Assert.AreEqual(20, settings.RapidUpdatesPerSecond);
}
[Test]
public void ChangeAndSaveSettings()
{
    Settings settings = Settings.Current;
    settings.PlayerName = ModifiedPlayerName;
    settings.TwoLetterLanguageName = ModifiedTwoLetterLanguageName;
    settings.StartInFullscreen = false;
    Assert.AreEqual(settings.TwoLetterLanguageName, ModifiedTwoLetterLanguageName);
    Assert.AreEqual(ModifiedPlayerName, settings.PlayerName);
    settings.Save();
}
[Test]
public void SetValueTwice()
{
    Settings settings = Settings.Current;
    settings.PlayerName = "Blub";
    settings.PlayerName = ModifiedPlayerName;
    Assert.AreEqual(ModifiedPlayerName, settings.PlayerName);
}
See Also