# PartPlan record

> One named piece of a game, in a MountPlan's Parts: what a Plugin's [[mounts]] can require, and what two players' copies are compared by. Name it after what something reads, such as content, map/gm_construct or a workshop item.

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

```csharp
public sealed record PartPlan
```

One named piece of a game, in a [MountPlan](/docs/api/mountplan)'s [Parts](/docs/api/mountplan#parts): what a Plugin's `[[mounts]]` can require, and what two players' copies are compared by. Name it after what something reads, such as `content`, `map/gm_construct` or a workshop item.

Its fingerprint is a hash over its defining files, taken the first time something asks for it.

## Members

### PartPlan (constructor)

```csharp
public PartPlan(string Name, IReadOnlyList<VirtualPath> DefiningFiles)
```

Makes a part from its name and the files that define it.

### Name (property)

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

The part's name, as a Plugin's manifest names it under `parts`.

### DefiningFiles (property)

```csharp
public IReadOnlyList<VirtualPath> DefiningFiles { get; init; }
```

The files the part is, by path in [Files](#files). Their bytes are hashed for the fingerprint, unless the part has [claims](#claims) or is [by index](#byindex). Leave out every file the game writes to itself, or the part changes the first time the game runs.

### Files (property)

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

The tree [DefiningFiles](#definingfiles) are read from. Left `null`, it's the probe's [Tree](/docs/api/mountprobe#tree). Set it for a part that sits in an external, like a workshop item.

### ByIndex (property)

```csharp
public bool ByIndex { get; init; }
```

`true` to hash the archive's own index rather than its files' bytes, through its container's `IIndexedContainer.ReadIndex`. An index that holds every file's checksum, as a GMA's does, still changes when any file does, so a part over gigabytes compares by reading kilobytes.

### Version (property)

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

A label for the part shown with it, such as a workshop item's own version. It's never compared.

### Claims (property)

```csharp
public IReadOnlyDictionary<VirtualPath, string> Claims { get; init; }
```

Hashes the game or its storefront keeps for each file, by path, used with each file's size in place of hashing its bytes. Steam's depot manifests give every Steam game's files a SHA-1 this way. Use them only where you know they change whenever a file's bytes do.

### Sha1Claims (property)

```csharp
public bool Sha1Claims { get; init; }
```

`true` when the [claims](#claims) are SHA-1s of the files' bytes. A file with no claim is then hashed by its own SHA-1, so a copy from another storefront fingerprints the same as a Steam copy wherever their files match.
