# WeaponAttachments record

> The attachments on a weapon's models its looks come from: the muzzle its flash, tracers and sounds start at, and the port its casings leave. A weapon record's attachments table names them, and so can each of its modes, whose own win name by name. Tracers, flashes and casings come from the view model's attachment in first person, and from the world model's by the same name in third person, or the hand when it has none.

Namespace `EvilEngine.Formats.Records`, assembly `EvilEngine.Formats`. Engine commit 4ff877b1.

```csharp
public sealed record WeaponAttachments
```

The attachments on a weapon's models its looks come from: the muzzle its flash, tracers and sounds start at, and the port its casings leave. A weapon record's `attachments` table names them, and so can each of its modes, whose own win name by name. Tracers, flashes and casings come from the view model's attachment in first person, and from the world model's by the same name in third person, or the hand when it has none.

```toml
attachments = { muzzle = "barrel_tip", eject = "port" }
```

## Members

### WeaponAttachments (constructor)

```csharp
public WeaponAttachments()
```

Makes a set naming no attachments, the same as [None](#none), for setting what you need.

### None (field)

```csharp
public static readonly WeaponAttachments None
```

No attachments named, what a record without an `attachments` table has, so the defaults are used.

### DefaultMuzzle (field)

```csharp
public const string DefaultMuzzle = "muzzle"
```

`"muzzle"`, the attachment the muzzle is when [Muzzle](#muzzle) is `null`.

### DefaultEject (field)

```csharp
public const string DefaultEject = "eject"
```

`"eject"`, the attachment casings leave from when [Eject](#eject) is `null`.

### Muzzle (property)

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

The muzzle attachment's name, from `muzzle`, or `null` for [DefaultMuzzle](#defaultmuzzle). An event's own `at` wins over it. It can't be empty.

### Eject (property)

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

The eject port attachment's name, from `eject`, or `null` for [DefaultEject](#defaulteject). An event's own `at` wins over it. It can't be empty.

### IsEmpty (property)

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

Whether neither attachment is named.

### Over (method)

```csharp
public WeaponAttachments Over(WeaponAttachments under)
```

This set over `under`: each name this one sets wins, and the rest come from `under`.
