Cauldron3D.Formats.Entities (Cauldron3D.Formats v0.3.3)

Copy Markdown View Source

A map's entity text read into a list of string maps, one per { … } block, in order.

Cauldron3D.Formats.Entities.parse(~s|{ "classname" "worldspawn" }|)
#=> [%{"classname" => "worldspawn"}]

Summary

Functions

The entities of text with the text of each block, braces included: [{block, keys}].

A number value as a float, or nil.

The entities of text.

A vector value such as "64 -32 24" as {x, y, z} floats, or nil.

Functions

blocks(text)

@spec blocks(String.t()) :: [{String.t(), %{required(String.t()) => String.t()}}]

The entities of text with the text of each block, braces included: [{block, keys}].

number(text)

@spec number(String.t() | nil) :: float() | nil

A number value as a float, or nil.

parse(text)

@spec parse(String.t()) :: [%{required(String.t()) => String.t()}]

The entities of text.

vector(text)

@spec vector(String.t() | nil) :: {float(), float(), float()} | nil

A vector value such as "64 -32 24" as {x, y, z} floats, or nil.