Yarnspinnex.Projection (yarnspinnex v0.3.0)

Copy Markdown View Source

A host-built view of game state that dialogue is allowed to read. fields holds the readable values; source keeps a reference to whatever it was projected from, for the host's own use. Dialogue reads fields and can never reach source.

Summary

Functions

Builds a projection from a map of readable fields, optionally remembering its :source.

Types

t()

@type t() :: %Yarnspinnex.Projection{
  fields: %{optional(atom() | String.t()) => term()},
  source: term()
}

Functions

new(fields, opts \\ [])

@spec new(
  map(),
  keyword()
) :: t()

Builds a projection from a map of readable fields, optionally remembering its :source.