Skip to content

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.

C#
public sealed record LaunchArguments : IEquatable<LaunchArguments>

Inheritance

object ← LaunchArguments

Implements

IEquatable<LaunchArguments>

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.

C#
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.

C#
public AudioOutput Audio { get; init; }

Property Value

AudioOutput

AudioCapturePath

–audio-capture: the WAV file to write what would have been heard to, or null.

C#
public string? AudioCapturePath { get; init; }

Property Value

string?

CaptureDirectory

–captures: where script captures are written (“captures” by default).

C#
public string CaptureDirectory { get; init; }

Property Value

string

Display

–display: the display to open on, or null to keep the game’s choice.

C#
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.

C#
public int? FrameRateLimit { get; init; }

Property Value

int?

Frames

–frames: stop after this many updates; 0 runs until the game quits.

C#
public long Frames { get; init; }

Property Value

long

Gpu

–gpu: the GPU to ask for, or null to keep the game’s choice.

C#
public GpuPreference? Gpu { get; init; }

Property Value

GpuPreference?

Graphics

–graphics: the graphics device to draw with, or null to keep the game’s choice.

C#
public string? Graphics { get; init; }

Property Value

string?

Headless

–headless: run without a window.

C#
public bool Headless { get; init; }

Property Value

bool

Hidden

–hidden: render into a hidden window.

C#
public bool Hidden { get; init; }

Property Value

bool

ListPlatforms

–list-platforms: print the catalog and exit.

C#
public bool ListPlatforms { get; init; }

Property Value

bool

Mute

–mute: no sound.

C#
public bool Mute { get; init; }

Property Value

bool

PaceToDisplay

–pacing: false for measured, true (the default) for display.

C#
public bool PaceToDisplay { get; init; }

Property Value

bool

Platform

The platform named with –platform, or null for the default.

C#
public string? Platform { get; init; }

Property Value

string?

ProfilePath

–profile: the file to write frame measurements to, or null to measure nothing.

C#
public string? ProfilePath { get; init; }

Property Value

string?

Renderers

–renderer: graphics APIs to try first, or null to keep the game’s choice.

C#
public IReadOnlyList<string>? Renderers { get; init; }

Property Value

IReadOnlyList<string>?

Report

–report: print the platform and its audio state before running.

C#
public bool Report { get; init; }

Property Value

bool

Scale

–scale: the window scale, or null for Scale.

C#
public int? Scale { get; init; }

Property Value

int?

ScriptPath

–script: the input script file, or null.

C#
public string? ScriptPath { get; init; }

Property Value

string?

Seed

–seed: the seed of Random. Without it, a run with a script uses 1 and any other run a clock-based seed.

C#
public int Seed { get; init; }

Property Value

int

StateTracePath

–state-trace: the file to write the per-step state hashes to (StateTrace), or null.

C#
public string? StateTracePath { get; init; }

Property Value

string?

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.

C#
public TimeMode? Time { get; init; }

Property Value

TimeMode?

VSync

–vsync: on or off, or null to keep the game’s choice.

C#
public bool? VSync { get; init; }

Property Value

bool?

WindowMode

–window: the window mode, or null to keep the game’s choice.

C#
public WindowMode? WindowMode { get; init; }

Property Value

WindowMode?

Methods

<Clone>$()

C#
public LaunchArguments <Clone>$()

Returns

LaunchArguments

ApplyTo(GraphicsSettings)

The game’s graphics options with the ones given on the command line in their place.

C#
public GraphicsSettings ApplyTo(GraphicsSettings graphics)

Parameters

graphics GraphicsSettings

Returns

GraphicsSettings

Deconstruct(out string?, out string, out bool, out bool, out long, out int, out int?, out bool)

C#
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?)

C#
public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(LaunchArguments?)

C#
public bool Equals(LaunchArguments? other)

Parameters

other LaunchArguments?

Returns

bool

From(LaunchRequest, int)

The typed view of request; a run that asks for no seed and plays no script gets clockSeed.

C#
public static LaunchArguments From(LaunchRequest request, int clockSeed)

Parameters

request LaunchRequest

clockSeed int

Returns

LaunchArguments

GetHashCode()

C#
public override int GetHashCode()

Returns

int

Parse(IReadOnlyList<string>)

Parses command-line arguments (Parse).

C#
public static LaunchArguments Parse(IReadOnlyList<string> args)

Parameters

args IReadOnlyList<string>

Returns

LaunchArguments

Exceptions

FormatException

An argument is unknown, misses its value or has an invalid one, –headless contradicts –platform, or the script file does not exist.

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(LaunchArguments?, LaunchArguments?)

C#
public static bool operator ==(LaunchArguments? left, LaunchArguments? right)

Parameters

left LaunchArguments?

right LaunchArguments?

Returns

bool

operator !=(LaunchArguments?, LaunchArguments?)

C#
public static bool operator !=(LaunchArguments? left, LaunchArguments? right)

Parameters

left LaunchArguments?

right LaunchArguments?

Returns

bool