Class GameManifest¶
Namespace: Apogee.Content.Packages
Assembly: Apogee.Content.dll
The game.xml at the root of a game folder: the game's name, who made it, its version, the folder of the player's files, its Steam app id, and the window it opens with. Checked against
the engine's schema (Packages/game.xsd) and further: the version is major.minor.patch, and the paths it names (the entry scene and the icon) are relative and stay inside the game.
A game without one still runs from a folder (it has no version and its user folder is named after the folder), but cannot be exported.
public sealed class GameManifest
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Fields¶
FileName¶
The name of the file, at the root of the game folder.
public const string FileName = "game.xml"
Field Value¶
Properties¶
Copyright¶
The copyright notice of the game.
public string Copyright { get; }
Property Value¶
Description¶
A short description of the game.
public string Description { get; }
Property Value¶
EntryScene¶
The scene that is loaded before the packages' scripts run, as a path inside the game (scenes/main.ascene), or null.
public string? EntryScene { get; }
Property Value¶
Executable¶
The name of the executable of an export, without its extension. Letters and digits of
public string Executable { get; }
Property Value¶
Icon¶
A square PNG as a path inside the game folder, or null.
public string? Icon { get; }
Property Value¶
Identifier¶
The reverse-DNS name of the game (com.studio.game): the bundle identifier on macOS, the application id on Linux.
public string Identifier { get; }
Property Value¶
Name¶
The name to show: the window title, the bundle name, the product name of an executable.
public string Name { get; }
Property Value¶
Organization¶
Who made the game: the folder that holds the player's files of every game of one maker, and the company of an executable.
public string Organization { get; }
Property Value¶
SteamAppId¶
The game's Steam app id, 0 for a game that is not on Steam.
public uint SteamAppId { get; }
Property Value¶
UserFolder¶
The name of the folder of the player's files, under the organization's.
public string UserFolder { get; }
Property Value¶
Version¶
The version of the game: what the gameVersion of each package is checked against.
public PackageVersion Version { get; }
Property Value¶
Window¶
The window the game opens with.
public GameWindow Window { get; }
Property Value¶
Methods¶
Load(string, out IReadOnlyList<string>)¶
Reads the game.xml in folder. Returns null, with no problems, when the folder has none (a game does not need one to run from a folder). Returns null with
problems when the file is wrong.
public static GameManifest? Load(string folder, out IReadOnlyList<string> problems)
Parameters¶
folder string
problems IReadOnlyList<string>
Returns¶
Exceptions¶
The file exists and cannot be read.
SanitizeFileName(string)¶
Makes name a name a folder can have on every platform: <>:"/|?* and control characters are dropped, and so are trailing dots and spaces. What is left empty
(or nothing but dots and spaces, which would name the folder itself or its parent) becomes Game.
public static string SanitizeFileName(string name)
Parameters¶
name string
Returns¶
ToXml()¶
The manifest as XML, with every value written out (the defaults too), so that reading it again gives the same manifest.
public string ToXml()
Returns¶
TryParse(string, string, out GameManifest?, out IReadOnlyList<string>)¶
Reads a manifest. problems lists everything wrong, as file:line: message; the manifest is null when anything is.
public static bool TryParse(string text, string origin, out GameManifest? manifest, out IReadOnlyList<string> problems)
Parameters¶
text string
The text of the file.
origin string
The file it came from, for the problems.
manifest GameManifest?
problems IReadOnlyList<string>
Returns¶
UserDirectory(string?)¶
The folder of the player's files: <local application data>/<organization>/<user folder>, each made a valid folder name by ~/.local/share on Linux, AppData/Local on Windows, ~/Library/Application Support on macOS).
public string UserDirectory(string? localAppData = null)
Parameters¶
localAppData string?
The folder that stands for the local application data; the platform's by default.
Returns¶
WithIcon(string?)¶
A copy of the manifest with another icon (or none): an export keeps its icon in the executable or the bundle, not at the path the game folder has it.
public GameManifest WithIcon(string? path)
Parameters¶
path string?
The game-relative path of the icon file, or null for none.