# ICrosshairs interface

> Every player's crosshair in a session, as the server holds it: the layers set over it and the events played on it. The host sends each player their part whenever it changes and plays the events on their screen, so nothing here needs the client.

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

```csharp
public interface ICrosshairs
```

Every player's crosshair in a session, as the server holds it: the layers set over it and the events played on it. The host sends each player their part whenever it changes and plays the events on their screen, so nothing here needs the client.

A Plugin reaches it through its context's [Crosshairs](/docs/api/plugincontext#crosshairs), where its layers are named `<id>:<name>` for it and go when it unloads. The host's own `crosshair_play`, `crosshair_hold` and `crosshair_release` commands and `just map-shot --crosshair-layer` and `--crosshair-hold` drive it too.

```csharp
crosshairs.Everyone.Set(new CrosshairLayer("ctf:teams") { Locked = [CrosshairKey.Colour] });
crosshairs.Of(sniper)?.Set(new CrosshairLayer("ctf:scope") { Priority = CrosshairLayer.Weapon, Hidden = true });
```

## Members

### Everyone (property)

```csharp
ICrosshair Everyone { get; }
```

The crosshair every player shares. A layer set here sits under each player's own of the same [priority](/docs/api/crosshairlayer#priority), and an event played here plays on every screen.

### Of (method)

```csharp
ICrosshair? Of(PlayerId player)
```

One player's own crosshair, or `null` when that [PlayerId](/docs/api/playerid) isn't connected. Their layers and events reach only them, and their layers go when they leave.
