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
AnimationDefinitionSource.cs
1using Newtonsoft.Json;
2
4
8public sealed class AnimationDefinitionSource
9{
10 [JsonConstructor]
11 private AnimationDefinitionSource() { }
12
16 [JsonProperty]
17 public AnimationDefinitionSourceKind Kind { get; private init; }
18
22 [JsonProperty]
23 public string? GaniFilePath { get; private init; }
24
28 [JsonProperty]
29 public string? AssetsFilePath { get; private init; }
30
34 [JsonProperty]
35 public string? AssetEntryName { get; private init; }
36
42 public static AnimationDefinitionSource LooseDefinitionFile(string ganiFilePath)
43 {
44 if (string.IsNullOrWhiteSpace(ganiFilePath))
45 throw new ArgumentException("GANI file path must be a non-empty string.", nameof(ganiFilePath));
46
47 return new AnimationDefinitionSource
48 {
49 Kind = AnimationDefinitionSourceKind.LooseDefinitionFile,
50 GaniFilePath = ganiFilePath
51 };
52 }
53
60 public static AnimationDefinitionSource PackedDefinitionFile(
61 string assetsFilePath,
62 string assetEntryName)
63 {
64 if (string.IsNullOrWhiteSpace(assetsFilePath))
65 throw new ArgumentException("Assets file path must be a non-empty string.", nameof(assetsFilePath));
66
67 if (string.IsNullOrWhiteSpace(assetEntryName))
68 throw new ArgumentException("Asset entry name must be a non-empty string.", nameof(assetEntryName));
69
70 return new AnimationDefinitionSource
71 {
72 Kind = AnimationDefinitionSourceKind.PackedDefinitionFile,
73 AssetsFilePath = assetsFilePath,
74 AssetEntryName = assetEntryName
75 };
76 }
77
82 public static AnimationDefinitionSource Generated() =>
84
89 public static AnimationDefinitionSource None() =>
91}
string? AssetEntryName
Gets the packed entry name when loaded from a packed definition file.
AnimationDefinitionSourceKind Kind
Gets the high-level source kind.
static AnimationDefinitionSource Generated()
Creates provenance for a definition generated from runtime state.
static AnimationDefinitionSource None()
Creates an empty definition-source descriptor.
string? GaniFilePath
Gets the .gani path when loaded from a loose definition file.
static AnimationDefinitionSource LooseDefinitionFile(string ganiFilePath)
Creates provenance for a definition stored in a loose file.
string? AssetsFilePath
Gets the .gaf path when loaded from a packed definition file.
static AnimationDefinitionSource PackedDefinitionFile(string assetsFilePath, string assetEntryName)
Creates provenance for a definition stored inside an assets file.
AnimationDefinitionSourceKind
Identifies where a GANI animation definition originated.