# `QuakeServer.Contents`
[🔗](https://github.com/jaman/quake_server/blob/v0.1.0/lib/quake_server/contents.ex#L1)

FTE's contents as bits (`bspfile.h`), and the translation from the codes Quake and
Half-Life maps store (`Q1BSP_TranslateContents`, and the contents a brush entity's
negative `skin` forces on all of its brushes).

    QuakeServer.Contents.of_code(-16)
    #=> QuakeServer.Contents.bit(:ladder)

Half-Life's currents are water with a current bit; its translucent contents are empty;
its clip brushes are player and monster clip.

# `bit`

```elixir
@spec bit(atom()) :: non_neg_integer()
```

The bit of contents `name`.

# `fluid`

```elixir
@spec fluid() :: non_neg_integer()
```

Water, slime, lava and sky: what Quake's code counts as a fluid.

# `fluid?`

```elixir
@spec fluid?(non_neg_integer()) :: boolean()
```

Whether `bits` hold a fluid.

# `fluid_code`

```elixir
@spec fluid_code(non_neg_integer()) :: integer()
```

Quake's code for fluid `bits`: lava, slime, water, or sky for any other fluid.

# `forced`

```elixir
@spec forced(integer()) :: non_neg_integer()
```

The bits a brush entity's negative `skin` forces on every brush of its model; `0` for a
skin that forces nothing.

# `from_dp`

```elixir
@spec from_dp(non_neg_integer()) :: non_neg_integer()
```

Darkplaces contents bits (`dphitcontentsmask`) as FTE's.

# `has?`

```elixir
@spec has?(non_neg_integer(), atom()) :: boolean()
```

Whether `bits` hold contents `name`.

# `of_code`

```elixir
@spec of_code(integer()) :: non_neg_integer()
```

The bits of contents code `code` a map's hull stores (`Q1BSP_TranslateContents`).

# `of_leaf`

```elixir
@spec of_leaf(integer()) :: non_neg_integer()
```

The bits a hull trace gives the leaf contents code `code` (`q1toftecontents`): clip is
player clip alone, Half-Life's translucent contents are window, its currents are the
current bits without water. A code below -16 counts as solid.

# `point_code`

```elixir
@spec point_code(non_neg_integer()) :: integer()
```

Quake's code for `bits` as the `pointcontents` builtin gives it: solid, sky, lava, slime, water, ladder or empty, the first held.

# `to_dp`

```elixir
@spec to_dp(non_neg_integer()) :: non_neg_integer()
```

FTE contents bits as Darkplaces'.

# `water_code`

```elixir
@spec water_code(non_neg_integer()) :: integer()
```

Quake's code for `bits` as a program's `watertype` reads it: lava, slime, water or empty.

---

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