Skip to content
EvilEngine.Mounts

Externals class

public sealed class Externals : IReadOnlyList<ResolvedExternal>

Every External a probe declared, resolved, in the order it declared them. The host hands it to Open, and the open mount keeps it. Look one up by name and check that it resolved before reading its files.

if (externals[Steamapps.Name] is not { IsResolved: true, Files: { } steamapps, Location: { } library } ||
    externals[Depotcache.Name] is not { IsResolved: true, Files: { } depotcache })
    return claims;

The host resolves each external in turn. The pointer’s [externals] table comes first, by the external’s name, unless the game’s own config switches it: a path there is used as it is, and false turns it off. Then an external that’s off by default stays off. A game external takes an open mount that fits, or opens a probe on offer that fits. Last comes the external’s hint, and with none it’s missing. A path is used only when it’s absolute and there: a folder is read as it is, a file through the container adapter that recognises it, and for a game external the path is probed. Every answer is a ResolvedExternal saying where it came from, so nothing missing throws.

Assembly
EvilEngine.Mounts
Commit
4ff877b1

Members

Externals constructor

public Externals(IEnumerable<ResolvedExternal> entries, IEnumerable<string>? unknown = null)

Makes a set from resolved externals and the names in the pointer that matched none. The host makes these. Tests and code calling Open by hand make their own, or use None.

None property

public static Externals None { get; }

A set with no externals, no unknown names and no key.

Unknown property

public IReadOnlyList<string> Unknown { get; }

Names in the pointer’s [externals] table that the game doesn’t declare, and that aren’t under one that TakesChildren, in ordinal order. They’re left out, and just mounts prints each as one the game doesn’t declare.

Key property

public MountKey? Key { get; init; }

The MountKey read from the file the pointer’s key names, or null when it names none. It’s read whatever the probe’s status, and holds a problem rather than bytes when it couldn’t be read.

this property

public ResolvedExternal? this[string name] { get; }
public ResolvedExternal this[int index] { get; }

The resolved external with that name, or null when the probe declared none by it. Names match exactly. With an index, the external at that place in the probe’s order, which throws IndexOutOfRangeException outside Count.

Count property

public int Count { get; }

How many externals the probe declared.

GetEnumerator method

public IEnumerator<ResolvedExternal> GetEnumerator()

Goes through the resolved externals in the probe’s order.