Gondwana Game Engine
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, mobile, and web platforms using SkiaSharp for graphics and NAudio for sound.
Loading...
Searching...
No Matches
Gondwana.Configuration.EngineConfigurationFile Class Reference

Represents a configuration file for the engine, providing functionality to create, load, and save engine settings. More...

Inheritance diagram for Gondwana.Configuration.EngineConfigurationFile:

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.

Detailed Description

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.

Member Function Documentation

◆ CreateNew()

EngineConfigurationFile Gondwana.Configuration.EngineConfigurationFile.CreateNew ( string? configFileName = null,
bool? autoSave = null )
static

Creates a new engine configuration file with default settings.

Parameters
configFileNameThe name of the configuration file to create. If null, uses the default file name "gondwana.json".
autoSaveA value indicating whether the configuration should be automatically saved when disposed. If null, defaults to false.
Returns
A new EngineConfigurationFile instance with default engine configuration settings.

◆ Dispose()

void Gondwana.Configuration.EngineConfigurationFile.Dispose ( )

Releases all resources used by the EngineConfigurationFile.

If AutoSave is true, the configuration is automatically saved before disposal.

◆ Load()

EngineConfigurationFile Gondwana.Configuration.EngineConfigurationFile.Load ( string? configFileName = null,
bool? autoSave = null )
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.

Parameters
configFileNameThe name of the configuration file to load. If null, uses the default file name "gondwana.json".
autoSaveA value indicating whether the configuration should be automatically saved when disposed. If null, defaults to false.
Returns
An EngineConfigurationFile instance loaded from the specified file, or a new instance with default settings if the file doesn't exist.

◆ Save() [1/2]

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.

◆ Save() [2/2]

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.

Parameters
jsonPathThe full path where the configuration file should be saved.

Property Documentation

◆ AutoSave

bool Gondwana.Configuration.EngineConfigurationFile.AutoSave = false
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.

◆ EngineConfig

EngineConfiguration Gondwana.Configuration.EngineConfigurationFile.EngineConfig = new()
get

Gets the engine configuration settings.

◆ FileName

string Gondwana.Configuration.EngineConfigurationFile.FileName
get

Gets the name of the configuration file without the directory path.

◆ FilePath

string Gondwana.Configuration.EngineConfigurationFile.FilePath
get

Gets the full path to the configuration file.