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.
Loading...
Searching...
No Matches
AssetsFileIdentifier.cs
1using Newtonsoft.Json;
2
3namespace Gondwana.Assets;
4
8public sealed class AssetsFileIdentifier
9{
13 [JsonProperty]
14 public AssetsFile AssetsFile { get; private set; } = null!;
15
19 [JsonProperty]
20 public AssetTypes AssetType { get; private set; }
21
25 [JsonProperty]
26 public string AssetName { get; private set; } = null!;
27
32 [JsonIgnore]
33 public bool IsValid => Data is not null;
34
39 [JsonIgnore]
40 public Stream? Data => AssetsFile?[AssetType, AssetName];
41
47
54 public AssetsFileIdentifier(AssetsFile resFile, AssetTypes resType, string entry)
55 {
56 AssetsFile = resFile;
57 AssetType = resType;
58 AssetName = entry;
59 }
60
65 public override string ToString() => $"Asset File {AssetsFile?.FilePath} / {AssetType} / {AssetName}";
66}
string AssetName
Gets the name of the asset.
bool IsValid
Gets a value indicating whether this asset identifier is valid and can retrieve data.
AssetTypes AssetType
Gets the type of the asset.
AssetsFileIdentifier(AssetsFile resFile, AssetTypes resType, string entry)
Initializes a new instance of the AssetsFileIdentifier class with the specified asset file,...
AssetsFile AssetsFile
Gets the AssetsFile that contains the asset.
Stream? Data
Gets the stream containing the asset data.
override string ToString()
Returns a string representation of this asset identifier.
AssetsFileIdentifier()
Initializes a new instance of the AssetsFileIdentifier class.
AssetTypes
Defines the types of assets that can be stored and managed by the engine.
Definition AssetTypes.cs:8