KernelAPI reference
Class LaunchArguments
Namespace: MicroEngine.Core
Assembly: MicroEngine.dll
Guide: Game lifecycle and time
The launcher command line with the engine’s own types (see GameLauncher): a typed view of a LaunchRequest, with the seed and the time mode resolved by its rules.
public sealed record LaunchArguments : IEquatable<LaunchArguments>Inheritance
Implements
Constructors
LaunchArguments(string?, string, bool, bool, long, int, int?, bool)
The launcher command line with the engine’s own types (see GameLauncher): a typed view of a LaunchRequest, with the seed and the time mode resolved by its rules.
public LaunchArguments(string? ScriptPath, string CaptureDirectory, bool Headless, bool Hidden, long Frames, int Seed, int? Scale, bool Mute)Parameters
ScriptPath string?
–script: the input script file, or null.
CaptureDirectory string
–captures: where script captures are written (“captures” by default).
Headless bool
–headless: run without a window.
Hidden bool
–hidden: render into a hidden window.
Frames long
–frames: stop after this many updates; 0 runs until the game quits.
Seed int
–seed: the seed of Random. Without it, a run with a script uses 1 and any other run a clock-based seed.
Scale int?
–scale: the window scale, or null for Scale.
Mute bool
–mute: no sound.
Properties
Audio
–audio: where sound may go.
public AudioOutput Audio { get; init; }Property Value
AudioCapturePath
–audio-capture: the WAV file to write what would have been heard to, or null.
public string? AudioCapturePath { get; init; }Property Value
CaptureDirectory
–captures: where script captures are written (“captures” by default).
public string CaptureDirectory { get; init; }Property Value
Display
–display: the display to open on, or null to keep the game’s choice.
public int? Display { get; init; }Property Value
int?
FrameRateLimit
–fps-limit: the frame limit (0 for none), or null to keep the game’s choice.
public int? FrameRateLimit { get; init; }Property Value
int?
Frames
–frames: stop after this many updates; 0 runs until the game quits.
public long Frames { get; init; }Property Value
Gpu
–gpu: the GPU to ask for, or null to keep the game’s choice.
public GpuPreference? Gpu { get; init; }Property Value
Graphics
–graphics: the graphics device to draw with, or null to keep the game’s choice.
public string? Graphics { get; init; }Property Value
Headless
–headless: run without a window.
public bool Headless { get; init; }Property Value
Hidden
–hidden: render into a hidden window.
public bool Hidden { get; init; }Property Value
ListPlatforms
–list-platforms: print the catalog and exit.
public bool ListPlatforms { get; init; }Property Value
Mute
–mute: no sound.
public bool Mute { get; init; }Property Value
PaceToDisplay
–pacing: false for measured, true (the default) for display.
public bool PaceToDisplay { get; init; }Property Value
Platform
The platform named with –platform, or null for the default.
public string? Platform { get; init; }Property Value
ProfilePath
–profile: the file to write frame measurements to, or null to measure nothing.
public string? ProfilePath { get; init; }Property Value
Renderers
–renderer: graphics APIs to try first, or null to keep the game’s choice.
public IReadOnlyList<string>? Renderers { get; init; }Property Value
Report
–report: print the platform and its audio state before running.
public bool Report { get; init; }Property Value
Scale
–scale: the window scale, or null for Scale.
public int? Scale { get; init; }Property Value
int?
ScriptPath
–script: the input script file, or null.
public string? ScriptPath { get; init; }Property Value
Seed
–seed: the seed of Random. Without it, a run with a script uses 1 and any other run a clock-based seed.
public int Seed { get; init; }Property Value
StateTracePath
–state-trace: the file to write the per-step state hashes to (StateTrace), or null.
public string? StateTracePath { get; init; }Property Value
Time
–time: how the loop advances time, or null to leave it to the game. A script means
Deterministic unless –time is given (EffectiveTime);
–hidden changes nothing; the headless platform’s RunPreset makes its runs deterministic when
this is null.
public TimeMode? Time { get; init; }Property Value
VSync
–vsync: on or off, or null to keep the game’s choice.
public bool? VSync { get; init; }Property Value
bool?
WindowMode
–window: the window mode, or null to keep the game’s choice.
public WindowMode? WindowMode { get; init; }Property Value
Methods
<Clone>$()
public LaunchArguments <Clone>$()Returns
ApplyTo(GraphicsSettings)
The game’s graphics options with the ones given on the command line in their place.
public GraphicsSettings ApplyTo(GraphicsSettings graphics)Parameters
graphics GraphicsSettings
Returns
Deconstruct(out string?, out string, out bool, out bool, out long, out int, out int?, out bool)
public void Deconstruct(out string? ScriptPath, out string CaptureDirectory, out bool Headless, out bool Hidden, out long Frames, out int Seed, out int? Scale, out bool Mute)Parameters
ScriptPath string?
CaptureDirectory string
Headless bool
Hidden bool
Frames long
Seed int
Scale int?
Mute bool
Equals(object?)
public override bool Equals(object? obj)Parameters
obj object?
Returns
Equals(LaunchArguments?)
public bool Equals(LaunchArguments? other)Parameters
other LaunchArguments?
Returns
From(LaunchRequest, int)
The typed view of request; a run that asks for no seed and plays no script gets clockSeed.
public static LaunchArguments From(LaunchRequest request, int clockSeed)Parameters
request LaunchRequest
clockSeed int
Returns
GetHashCode()
public override int GetHashCode()Returns
Parse(IReadOnlyList<string>)
Parses command-line arguments (Parse).
public static LaunchArguments Parse(IReadOnlyList<string> args)Parameters
args IReadOnlyList<string>
Returns
Exceptions
An argument is unknown, misses its value or has an invalid one, –headless contradicts –platform, or the script file does not exist.
ToString()
public override string ToString()Returns
Operators
operator ==(LaunchArguments?, LaunchArguments?)
public static bool operator ==(LaunchArguments? left, LaunchArguments? right)Parameters
left LaunchArguments?
right LaunchArguments?
Returns
operator !=(LaunchArguments?, LaunchArguments?)
public static bool operator !=(LaunchArguments? left, LaunchArguments? right)Parameters
left LaunchArguments?
right LaunchArguments?