![]() |
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.
|
Thread-safe singleton registry for Tilesheet instances. More...
Public Member Functions | |
| bool | TryGet (string name, out Tilesheet? sheet) |
| Attempts to retrieve a Tilesheet by its name from the registry. | |
| Tilesheet? | GetOrNull (string name) |
Retrieves a Tilesheet by its name from the registry, or null if not found. | |
| bool | Remove (string name, bool dispose=false) |
| Removes the tilesheet with the specified name from the collection. | |
| void | Clear () |
| Removes all tilesheets from the registry and disposes them. | |
| IImmutableDictionary< string, Tilesheet > | GetAll () |
| Gets an immutable snapshot of all registered tilesheets as a dictionary. | |
Properties | |
| static TilesheetRegistry | Instance [get] |
| Gets the singleton instance of the TilesheetRegistry. | |
| IReadOnlyList< string > | Names [get] |
| Gets a read-only list of all tilesheet names currently registered in the registry. | |
| int | Count [get] |
| Gets the number of tilesheets currently registered in the registry. | |
Thread-safe singleton registry for Tilesheet instances.
| void Gondwana.Drawing.Tilesheets.TilesheetRegistry.Clear | ( | ) |
Removes all tilesheets from the registry and disposes them.
This method is thread-safe. All tilesheets in the registry are disposed after being removed. Use with caution as any external references to the tilesheets will reference disposed objects.
| IImmutableDictionary< string, Tilesheet > Gondwana.Drawing.Tilesheets.TilesheetRegistry.GetAll | ( | ) |
Gets an immutable snapshot of all registered tilesheets as a dictionary.
This method is thread-safe and returns a snapshot of the registry at the time of invocation. The returned dictionary uses the same string comparer as the internal collection.
| Tilesheet? Gondwana.Drawing.Tilesheets.TilesheetRegistry.GetOrNull | ( | string | name | ) |
Retrieves a Tilesheet by its name from the registry, or null if not found.
| name | The name of the tilesheet to retrieve. |
null if not found.This method is thread-safe and provides a convenient alternative to TryGet when a null return value is acceptable.
| bool Gondwana.Drawing.Tilesheets.TilesheetRegistry.Remove | ( | string | name, |
| bool | dispose = false ) |
Removes the tilesheet with the specified name from the collection.
| name | The name of the tilesheet to remove. Cannot be null. |
| dispose | A value indicating whether the removed tilesheet should be disposed. true to dispose the tilesheet; otherwise, false. This is to prevent issues where a Tilesheet is removed, but existing references still exist. |
true if the tilesheet was successfully removed; otherwise, false.| ArgumentNullException | Thrown if name is null. |
| bool Gondwana.Drawing.Tilesheets.TilesheetRegistry.TryGet | ( | string | name, |
| out Tilesheet? | sheet ) |
Attempts to retrieve a Tilesheet by its name from the registry.
| name | The name of the tilesheet to retrieve. Cannot be null. |
| sheet | When this method returns, contains the tilesheet associated with the specified name, if found; otherwise, null. |
true if the tilesheet was found in the registry; otherwise, false.This method is thread-safe. If name is null, a warning is logged and the method returns false.
|
get |
Gets the number of tilesheets currently registered in the registry.
The total count of registered tilesheets.
This property is thread-safe.
|
staticget |
Gets the singleton instance of the TilesheetRegistry.
The singleton instance.
|
get |
Gets a read-only list of all tilesheet names currently registered in the registry.
A read-only list containing the names of all registered tilesheets.
This property is thread-safe and returns a snapshot of the names at the time of access.