View Source Kalevala.World.Room.Context (kalevala v0.1.0)

Context for performing work for an event in a room

Link to this section Summary

Functions

Add to the assignment map on the context

Send an event back to a pid

Handle context after processing an event

Create a new context struct from room state

Render a prompt back to a pid

Link to this section Types

@type t() :: %Kalevala.World.Room.Context{
  assigns: term(),
  characters: term(),
  data: term(),
  events: term(),
  item_instances: term(),
  output: term()
}

Link to this section Functions

Link to this function

assign(context, key, value)

View Source

Add to the assignment map on the context

Link to this function

event(context, to_pid, from_pid, topic, data)

View Source

Send an event back to a pid

Handle context after processing an event

Create a new context struct from room state

Link to this function

prompt(context, to_pid, view, template, assigns)

View Source

Render a prompt back to a pid

Link to this function

render(context, to_pid, view, template, assigns \\ %{})

View Source

Render text back to a pid