# ISelection interface

> One player's weapon selection, or everyone's (ISelections): the layers over it.

Namespace `EvilEngine.Api.Selection`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public interface ISelection
```

One player's weapon selection, or everyone's ([ISelections](/docs/api/iselections)): the layers over it.

Layers stay until cleared and reach the player as soon as they change. [Set](#set) throws `ArgumentException` naming what's wrong when a layer has no source or a slot count outside 1 to 10.

```csharp
selection.Set(new SelectionLayer("ctf:intro") { Locked = true });
selection.Clear("ctf:intro");
```

## Members

### Layers (property)

```csharp
IReadOnlyList<SelectionLayer> Layers { get; }
```

The layers set on this selection, in the order they were set. What the player gets stacks them by [priority](/docs/api/selectionlayer#priority) over everyone's.

### Set (method)

```csharp
void Set(SelectionLayer layer)
```

Sets a [SelectionLayer](/docs/api/selectionlayer), replacing the one with the same [Source](/docs/api/selectionlayer#source). Setting one equal to what's there sends nothing.

### Clear (method)

```csharp
bool Clear(string source)
```

Drops the layer with that source. Returns `false` when there was none.
