# ResolvedExternal record

> One External after the host has looked for it: whether it was found, where the answer came from, and the files it found. An adapter's Open gets them in Externals, by name.

Namespace `EvilEngine.Mounts`, assembly `EvilEngine.Mounts`. Engine commit 4ff877b1.

```csharp
public sealed record ResolvedExternal
```

One [External](/docs/api/external) after the host has looked for it: whether it was found, where the answer came from, and the files it found. An adapter's [Open](/docs/api/igameadapter#open) gets them in [Externals](/docs/api/externals), by name.

```csharp
if (externals[Workshop.External.Name] is not { IsResolved: true, Files: { } files } workshop)
    return mods;
```

Treat anything but resolved as absent: leave its content out and say so in the plan's notes if it matters. It prints as one line, as in `steamapps = /games/SteamLibrary/steamapps, from hint` or `portal = missing, from finder (steam:app/400 isn't installed)`, which is what `just mounts` lists under externals.

## Members

### ResolvedExternal (constructor)

```csharp
public ResolvedExternal(External Declared, ExternalState State, ExternalFrom From)
```

Makes a resolved external from the declared one, its state and where the answer came from. The host makes these. Tests make their own.

### Declared (property)

```csharp
public External Declared { get; init; }
```

The [External](/docs/api/external) the probe declared, with its title, hint and flags.

### State (property)

```csharp
public ExternalState State { get; init; }
```

`ExternalState.Resolved` when it was found, `Off` when the game or the pointer turned it off, and `Missing` when it was looked for and not found. [Detail](#detail) says why it's missing.

### From (property)

```csharp
public ExternalFrom From { get; init; }
```

Where the answer came from, as an `ExternalFrom`: `Player` for the pointer's `[externals]` table, `Game` for the game's own default or config turning it off, `Mount` for an open mount or a probe on offer that a game external took, `Hint` for a host path or a path beside the pointer, `Finder` for a store hint, and `Nowhere` when it has no hint and the pointer doesn't name it.

### Name (property)

```csharp
public string Name { get; }
```

The [Declared](#declared) external's name.

### Location (property)

```csharp
public string? Location { get; init; }
```

The full host path it resolved to. For a game external taken from a mount it's that mount's location. A missing one keeps the path that was tried when there was one, such as a hint's folder that isn't there, and is `null` when there wasn't. An off one is `null`.

### Files (property)

```csharp
public IFileSource? Files { get; init; }
```

What it holds, when it resolved: the folder as an [IFileSource](/docs/api/ifilesource), an archive opened by the container adapter that recognises it, or for a game external the tree the other game was probed from. `null` otherwise. Files the host opened for it, not a mount's, belong to the mount that asked and are released when that mount closes.

### Mount (property)

```csharp
public Mount? Mount { get; init; }
```

The other game's mount, for a game external that resolved, or `null`. The host opens it if it wasn't open already.

### Children (property)

```csharp
public IReadOnlyDictionary<string, ExternalSetting> Children { get; init; }
```

The pointer's settings under this external's name, for one that [TakesChildren](/docs/api/external#takeschildren), keyed by what follows `<name>/`. Each is an absolute path, or on or off. Steam's workshop reads `"workshop/123456789" = false` as item `123456789` turned off, and notes a setting for an item that isn't installed. Empty for an external that takes no children.

### Detail (property)

```csharp
public string? Detail { get; init; }
```

Why it's missing, as in `/home/you/.frictionalgames/Amnesia isn't there`, or a note on a setting that was left out, or `null`. A [GameSwitches](/docs/api/external#gameswitches) external says here when the pointer's setting was left out.

### IsResolved (property)

```csharp
public bool IsResolved { get; }
```

Whether [State](#state) is resolved. When it's `true`, [Files](#files) and [Location](#location) are set.
