# FileLayer record

> The layer a file in a layered mount comes from, as ConversionContext.LayerOf gives it: the name and role its LayerPlan was given. It's the layer whose copy wins, so a file a Garry's Mod addon overrides comes from the addon's layer.

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

```csharp
public sealed record FileLayer
```

The layer a file in a layered mount comes from, as [ConversionContext.LayerOf](/docs/api/conversioncontext#layerof) gives it: the name and role its [LayerPlan](/docs/api/layerplan) was given. It's the layer whose copy wins, so a file a Garry's Mod addon overrides comes from the addon's layer.

```csharp
if (context.LayerOf(entry.Path) is { Role: "addon" or "workshop" } layer)
    context.Warn($"{entry.Path} comes from {layer.Name}.");
```

## Members

### FileLayer (constructor)

```csharp
public FileLayer(string Name, string Role)
```

Makes a layer from its name and role. The pipeline makes them for [LayerOf](/docs/api/conversioncontext#layerof); you only need to make one to test code that takes it.

### Name (property)

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

The layer's name, as its [LayerPlan](/docs/api/layerplan#name) gives it. It's the name [TryReadCopy](/docs/api/conversioncontext#tryreadcopy) takes and [Copies](/docs/api/conversioncontext#copies) lists.

### Role (property)

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

What the layer is to its game, in a word, as its [LayerPlan](/docs/api/layerplan#role) gives it, such as `base`, `dlc`, `addon` or `workshop`. The map converters tag a map's origin by it: community for `addon`, `download`, `workshop` or `mod`, expansion for `dlc`, official for anything else.
