Yarnspinnex.Script (yarnspinnex v0.3.0)

Copy Markdown View Source

A parsed Yarn script ready to run: nodes indexed by title, which one Yarnspinnex.start/2 should enter, the Yarnspinnex.HostFunctions module its calls resolve against, and a fingerprint per node that cursors carry so a stale one is caught. Plain data - safe to cache (in ETS, a map, wherever) across dialogue turns.

Summary

Types

option()

@type option() ::
  {:functions, module() | nil}
  | {:strict, boolean()}
  | {:known_variables, MapSet.t(String.t())}

t()

@type t() :: %Yarnspinnex.Script{
  fingerprints: %{optional(String.t()) => non_neg_integer()},
  functions: module() | nil,
  nodes: %{optional(String.t()) => Yarnspinnex.Node.t()},
  start_title: String.t()
}