App settings loaded from and saved to file.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Core Settings
DeltaEngine.Platforms FileSettings
Namespace: DeltaEngine.Platforms
Assembly: DeltaEngine.Platforms (in DeltaEngine.Platforms.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The FileSettings type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FileSettings | Initializes a new instance of the FileSettings class |
Methods
Name | Description | |
---|---|---|
Dispose | (Inherited from Settings.) | |
GetValue T | (Overrides Settings GetValue T (String, T).) | |
LoadDefaultSettings | (Overrides Settings LoadDefaultSettings .) | |
Save | (Overrides Settings Save .) | |
SetValue | (Overrides Settings SetValue(String, Object).) |
Fields
Name | Description | |
---|---|---|
wasChanged | (Inherited from Settings.) |
Properties
Name | Description | |
---|---|---|
AntiAliasingSamples |
4 works on most frameworks, but some have AA disabled, use 0 to keep all frameworks in sync
View code on GitHub (Inherited from Settings.) | |
ColorBufferBits | (Inherited from Settings.) | |
CustomSettingsExists | (Inherited from Settings.) | |
DepthBufferBits | (Inherited from Settings.) | |
LimitFramerate | (Inherited from Settings.) | |
MusicVolume | (Inherited from Settings.) | |
OnlineServiceIp | (Inherited from Settings.) | |
OnlineServicePort | (Inherited from Settings.) | |
PlayerName | (Inherited from Settings.) | |
ProfilingModes | (Inherited from Settings.) | |
RapidUpdatesPerSecond | (Inherited from Settings.) | |
Resolution | (Inherited from Settings.) | |
SoundVolume | (Inherited from Settings.) | |
StartInFullscreen | (Inherited from Settings.) | |
TwoLetterLanguageName | (Inherited from Settings.) | |
UpdatesPerSecond | (Inherited from Settings.) | |
UseOnlineLogging | (Inherited from Settings.) | |
UseVSync | (Inherited from Settings.) |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void CheckDefaultSettings() { Assert.AreEqual(false, fileSettings.StartInFullscreen); Assert.AreEqual(1.0f, fileSettings.SoundVolume); Assert.AreEqual(0.75f, fileSettings.MusicVolume); Assert.AreEqual(24, fileSettings.DepthBufferBits); Assert.AreEqual(32, fileSettings.ColorBufferBits); Assert.AreEqual(0, fileSettings.AntiAliasingSamples); Assert.AreEqual(0, fileSettings.LimitFramerate); Assert.AreEqual(20, fileSettings.UpdatesPerSecond); }
[Test, CloseAfterFirstFrame] public void ChangeAndSaveSettings() { fileSettings.PlayerName = ModifiedPlayerName; fileSettings.TwoLetterLanguageName = ModifiedTwoLetterLanguageName; fileSettings.Save(); Assert.IsTrue(File.Exists(SettingsFilePath)); }
[Test] public void ChangeFileSettings() { fileSettings.StartInFullscreen = true; Assert.AreEqual(true, fileSettings.StartInFullscreen); fileSettings.StartInFullscreen = false; }
See Also