package verb
import "git.teletypegames.org/engines/inkwell/verb"
Package verb holds the Verb type, its Manager and the SCUMM verb set.
A verb is a canonical Name ("look"), a Label in every language the game speaks, and a Default action run when a hotspot has no handler for it. Defaults is the built-in set — look, use, talk and take, in English and Hungarian — which inkwell.New registers unless the game hands over a VerbManager that already holds verbs. A game adds its own verbs by registering them, answers them on a hotspot through OnVerb, and changes a preset (a third language, a shorter label) with the manager's Set. The verb bar and the verb wheel read the manager every frame, so a verb added at runtime shows at once.
Index
Types
type Manager
type Manager = inkbase.Manager[*Verb]
Manager is the registry of verbs, keyed by Verb.Name and kept in registration order; see inkbase.Manager.
func NewManager
func NewManager() *Manager
NewManager returns an empty Manager of verbs.
type Verb
type Verb struct { Name string Label inkbase.Text Default inkbase.Action }
Verb is a registered "action word" (Look, Use, Talk, Take, …). The VerbBar / RadialVerbs widgets read the VerbManager to know which verbs to render; Hotspot.handler(name) looks up the bound action by Verb.Name.
func Defaults
func Defaults() []*Verb
Defaults returns the built-in SCUMM-style verb set. New registers them so the demo works out of the box.
func (Verb) GetName
func (v Verb) GetName() string
GetName returns the verb's Name, the key it is registered under.
func (Verb) TypeLabel
func (v Verb) TypeLabel() string
TypeLabel returns "verb", the kind that tells a verb apart from other entities of the same Name in saved state and in panic messages.