View Source Kalevala.Verb (kalevala v0.1.0)

A verb is a discrete action that the player may perform

Things like picking up or dropping items, stealing, etc.

Link to this section Summary

Functions

Check if a list of verbs contains a verb that matches the context

Check if the location condition matches the context

Check if a verb matches the context

Link to this section Functions

Link to this function

has_matching_verb?(verbs, verb_key, context)

View Source

Check if a list of verbs contains a verb that matches the context

Link to this function

matches_location?(arg1, context)

View Source

Check if the location condition matches the context

No location condition == all locations are good

iex> Verb.matches_location?(%{location: ["room"]}, %{location: "room"})
true

iex> Verb.matches_location?(%{location: ["inventory/self"]}, %{location: "inventory/self"})
true

iex> Verb.matches_location?(%{location: ["inventory"]}, %{location: "inventory/self"})
true

Check if a verb matches the context

Link to this function

replace_variables(verbs, variables)

View Source