![]() |
Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
|
Represents a configuration file for the engine, providing functionality to create, load, and save engine settings. More...
Public Member Functions | |
| void | Save () |
| Saves the configuration to the file specified by FilePath. | |
| void | Save (string jsonPath) |
| Saves the configuration to the specified file path. | |
| void | Dispose () |
| Releases all resources used by the EngineConfigurationFile. | |
Static Public Member Functions | |
| static EngineConfigurationFile | CreateNew (string? configFileName=null, bool? autoSave=null) |
| Creates a new engine configuration file with default settings. | |
| static EngineConfigurationFile | Load (string? configFileName=null, bool? autoSave=null) |
| Loads an engine configuration file from disk. | |
Properties | |
| string | FileName [get] |
| Gets the name of the configuration file without the directory path. | |
| string | FilePath [get] |
| Gets the full path to the configuration file. | |
| bool | AutoSave = false [get, set] |
| Gets or sets a value indicating whether the configuration should be automatically saved when the instance is disposed. | |
| EngineConfiguration | EngineConfig = new() [get] |
| Gets the engine configuration settings. | |
| EngineConfiguration | Configuration [get] |
| Gets the engine configuration represented by this file-backed store. | |
Represents a configuration file for the engine, providing functionality to create, load, and save engine settings.
This class manages the persistence of EngineConfiguration to and from a JSON file. It supports automatic saving on disposal and can be created from scratch or loaded from an existing file.
Definition at line 12 of file EngineConfigurationFile.cs.
|
static |
Creates a new engine configuration file with default settings.
| configFileName | The name of the configuration file to create. If null, uses the default file name "gondwana.json". |
| autoSave | A value indicating whether the configuration should be automatically saved when disposed. If null, defaults to false. |
Definition at line 26 of file EngineConfigurationFile.cs.
| void Gondwana.Configuration.EngineConfigurationFile.Dispose | ( | ) |
Releases all resources used by the EngineConfigurationFile.
If AutoSave is true, the configuration is automatically saved before disposal.
Definition at line 123 of file EngineConfigurationFile.cs.
|
static |
Loads an engine configuration file from disk.
If the specified file does not exist or cannot be read, a new configuration with default settings is created. The configuration file is monitored for changes and will reload automatically when modified.
| configFileName | The name of the configuration file to load. If null, uses the default file name "gondwana.json". |
| autoSave | A value indicating whether the configuration should be automatically saved when disposed. If null, defaults to false. |
Definition at line 46 of file EngineConfigurationFile.cs.
| void Gondwana.Configuration.EngineConfigurationFile.Save | ( | ) |
Saves the configuration to the file specified by FilePath.
The configuration is serialized to JSON with indented formatting for readability.
Implements Gondwana.Configuration.IEngineConfigurationStore.
Definition at line 101 of file EngineConfigurationFile.cs.
| void Gondwana.Configuration.EngineConfigurationFile.Save | ( | string | jsonPath | ) |
Saves the configuration to the specified file path.
The configuration is serialized to JSON with indented formatting. After saving, the FileName property is updated to reflect the new path.
| jsonPath | The full path where the configuration file should be saved. |
Definition at line 112 of file EngineConfigurationFile.cs.
|
getset |
Gets or sets a value indicating whether the configuration should be automatically saved when the instance is disposed.
When set to true, the Save() method is automatically called during disposal.
Implements Gondwana.Configuration.IEngineConfigurationStore.
Definition at line 84 of file EngineConfigurationFile.cs.
|
get |
Gets the engine configuration represented by this file-backed store.
Implements Gondwana.Configuration.IEngineConfigurationStore.
Definition at line 95 of file EngineConfigurationFile.cs.
|
get |
Gets the engine configuration settings.
Definition at line 89 of file EngineConfigurationFile.cs.
|
get |
Gets the name of the configuration file without the directory path.
Definition at line 67 of file EngineConfigurationFile.cs.
|
get |
Gets the full path to the configuration file.
Definition at line 77 of file EngineConfigurationFile.cs.