Skip to content

GameHostOptions

namespace Griff.Runtime;
public sealed class GameHostOptions

What a host hands a game it makes (NewGame): the input its window or page feeds, the sound it plays through, where it keeps its saves, whether it plays over the network and where its problems are said. Left out, each is the game’s own: fresh input, silence, saves kept in memory, the network on this machine only.

public IAudio? Audio { get; init; }

What the game’s sound plays through (a MixerAudio on the host’s mixer); silent if null.

public IReadOnlyDictionary<string, IReadOnlyList<InputBinding>>? Controls { get; init; }

The game’s input actions with their bindings, as the project’s Controls say, for a host that has no project to read them from (a simulation’s); null leaves them as the project, or the built-in ones, have them.

public InputState? Input { get; init; }

The input the host feeds from its keyboard, mouse, touch and controllers; a fresh one if null.

public bool OverNetwork { get; init; }

Whether the game hosts and joins over the network (OverNetwork): only the player’s and the editor’s Play in its window do.

public Action<Problem>? Problems { get; init; }

Told each problem the game reports (something set up without code that can’t do its job).

public SaveData? SaveData { get; init; }

Where the game keeps its saves; in memory if null.

public int? SaveVersion { get; init; }

The game’s SaveVersion, for a host with no project to read it from; null leaves it as it is.

public TableSet? Tables { get; init; }

The tables it plays with, rather than the project’s files read afresh: the editor’s, kept across replays, or a simulation step’s.

public INetTransport? Transport { get; init; }

What the game’s network play goes over (Transport): UDP if null. A platform with its own way to reach other machines hands its own.

public override bool Equals(object? obj)
public bool Equals(GameHostOptions? other)
public override int GetHashCode()
public override string ToString()