# `Cauldron2D.Net.Link.Local`
[🔗](https://github.com/jaman/cauldron/blob/v0.1.3/cauldron_2d_net/lib/cauldron_2d/net/link/local.ex#L1)

A player's connection to a world reachable as a process — on this node, or
on a node this one is connected to — through `Cauldron2D.Net.Session`, so the frames
arrive in the same shape a `Cauldron2D.Net.Link.Socket` delivers.

    {:ok, link} = Cauldron2D.Net.Link.Local.start_link(game: MyGame.Client, world: pid, name: "alice", props: %{}, owner: self())

The owner receives `{:cauldron_link, :sheet, sheet, png}` once, `{:cauldron_link, :map, map}`
once, `{:cauldron_link, :frame, frame}` each tick and `{:cauldron_link, :closed, reason}`
when the world goes. Sound plays through `:sink` (default `TuningFork.Sink.Speaker`),
on this machine. `input/2`, `levels/3` and `leave/1` are what the player does.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `input`

```elixir
@spec input(GenServer.server(), %{held: [String.t()], aim: [number()] | nil}) :: :ok
```

What the player holds and aims at, as `Cauldron2D.Wx.Input.state/1` gives it.

# `leave`

```elixir
@spec leave(GenServer.server()) :: :ok
```

Leave the world and stop.

# `levels`

```elixir
@spec levels(GenServer.server(), number(), number()) :: :ok
```

The effects and music levels.

# `pause`

```elixir
@spec pause(GenServer.server()) :: :ok
```

Pause or resume a world of the player's own; nothing for a shared one.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Join `:world` as `:name` with `:props` for `:game`, reporting to `:owner`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
