Gondwana Game Engine Development (master) - 2.7.0
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
AssetLocation.cs
2
7public sealed class AssetLocation
8{
10 public AssetTypes AssetType { get; }
11
13 public string Path { get; }
14
16 public string? AssetEntryName { get; }
17
22 public AssetLocation(AssetTypes assetType, string path, string? assetEntryName = null)
23 {
24 if (!Enum.IsDefined(assetType))
25 throw new ArgumentOutOfRangeException(nameof(assetType));
26
27 ArgumentException.ThrowIfNullOrWhiteSpace(path);
28
29 if (!System.IO.Path.IsPathFullyQualified(path))
30 throw new ArgumentException("A physical location requires an absolute path.", nameof(path));
31
32 if (assetEntryName is not null)
33 ArgumentException.ThrowIfNullOrWhiteSpace(assetEntryName);
34
35 AssetType = assetType;
36 Path = System.IO.Path.GetFullPath(path);
37
38 if (string.IsNullOrEmpty(System.IO.Path.GetFileName(Path)))
39 throw new ArgumentException(
40 "A physical location must name a file, not a filesystem root or directory path.",
41 nameof(path));
42
43 AssetEntryName = assetEntryName;
44 }
45
49 internal bool Matches(AssetLocation other) => AssetType == other.AssetType &&
50 string.Equals(
51 Path,
52 other.Path,
53 OperatingSystem.IsWindows()
54 ? StringComparison.OrdinalIgnoreCase
55 : StringComparison.Ordinal) &&
56 string.Equals(
58 other.AssetEntryName,
59 StringComparison.OrdinalIgnoreCase);
60
63 public override string ToString() =>
64 $"{AssetType}: {Path}" + (AssetEntryName is null ? "" : $" :: {AssetEntryName}");
65}
A physical endpoint for reference transformation, without opening files or archives....
AssetTypes AssetType
Gets the resource or definition type, including for loose files.
override string ToString()
Formats the typed physical location for diagnostics.
string Path
Gets the absolute loose file path or containing GAF path.
string? AssetEntryName
Gets the typed GAF entry name, or null for a loose file.
AssetLocation(AssetTypes assetType, string path, string? assetEntryName=null)
Creates a physical endpoint; relative and drive-relative paths are rejected.
AssetTypes
Defines the types of assets that can be stored and managed by the engine.
Definition AssetTypes.cs:8