# `QuakeServer.World.Area`
[🔗](https://github.com/jaman/quake_server/blob/v0.1.0/lib/quake_server/world/area.ex#L1)

The grid linked entities are filed in: 128 by 128 cells across the world model's
ground, each at least 128 units wide, and one list for entities too large for it.

An entity whose box spans more than 16 cells, or reaches the grid's last row or column,
goes in the large list; any other is filed in every cell its box covers. Each cell
keeps its entities in the order they were filed. `entities/3` lists those whose cells
a box covers: the large list first, then the cells column by column, each entity once.

    grid = QuakeServer.World.Area.grid(world_mins, world_maxs)
    cells = QuakeServer.World.Area.cells(grid, absmin, absmax)
    area = QuakeServer.World.Area.file(area, entity, cells)
    QuakeServer.World.Area.entities(area, grid, {mins, maxs})

# `cell`

```elixir
@type cell() :: non_neg_integer() | :large
```

# `grid`

```elixir
@type grid() :: %{scale: {float(), float()}, bias: {float(), float()}}
```

# `cells`

```elixir
@spec cells(grid(), Cauldron3D.Vec.t(), Cauldron3D.Vec.t()) :: [cell()]
```

The cells an entity with box `absmin`..`absmax` is filed in.

# `entities`

```elixir
@spec entities(map(), grid(), {Cauldron3D.Vec.t(), Cauldron3D.Vec.t()}) :: [
  non_neg_integer()
]
```

The entities filed in the large list and in the cells box `{mins, maxs}` covers, in order, each once.

# `file`

```elixir
@spec file(map(), non_neg_integer(), [cell()]) :: map()
```

`entity` added to the end of each of `cells`.

# `grid`

```elixir
@spec grid(Cauldron3D.Vec.t(), Cauldron3D.Vec.t()) :: grid()
```

The grid over a world model whose bounds are `mins`..`maxs`.

# `unfile`

```elixir
@spec unfile(map(), non_neg_integer(), [cell()]) :: map()
```

`entity` taken out of each of `cells`.

---

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