Versions in this module Expand all Collapse all v0 v0.5.2 Apr 3, 2023 Changes in this version type StringTableRow + Tags []string v0.5.1 Apr 2, 2023 Changes in this version type StringTable + func LoadFilesFS(fsys fs.FS, programPath, stringTablePath, langCode string) (*yarnpb.Program, *StringTable, error) + func LoadStringTableFileFS(fsys fs.FS, stringTablePath, langCode string) (*StringTable, error) v0.5.0 Apr 2, 2023 Changes in this version + const ErrFunctionArgMismatch + const ErrFunctionNotFound + const ErrLabelNotFound + const ErrMissingProgram + const ErrNilDialogueHandler + const ErrNilOperand + const ErrNilVariableStorage + const ErrNoOptions + const ErrNodeNotFound + const ErrNotConvertible + const ErrStackUnderflow + const ErrWrongType + const Stop + func ConvertToBool(x interface{}) (bool, error) + func ConvertToFloat32(x interface{}) (float32, error) + func ConvertToFloat64(x interface{}) (float64, error) + func ConvertToInt(x interface{}) (int, error) + func ConvertToString(x interface{}) string + func FormatInstruction(inst *yarnpb.Instruction) string + func FormatProgram(w io.Writer, prog *yarnpb.Program) error + func FormatProgramString(prog *yarnpb.Program) string + func LoadProgramFile(programPath string) (*yarnpb.Program, error) + type Attribute struct + End int + Name string + Props map[string]string + Start int + type AttributedString struct + func (s *AttributedString) ScanAttribEvents(visit func(pos int, atts []*Attribute)) + func (s *AttributedString) String() string + type DialogueHandler interface + Command func(command string) error + DialogueComplete func() error + Line func(line Line) error + NodeComplete func(nodeName string) error + NodeStart func(nodeName string) error + Options func(options []Option) (int, error) + PrepareForLines func(lineIDs []string) error + type FakeDialogueHandler struct + func (FakeDialogueHandler) Command(string) error + func (FakeDialogueHandler) DialogueComplete() error + func (FakeDialogueHandler) Line(Line) error + func (FakeDialogueHandler) NodeComplete(string) error + func (FakeDialogueHandler) NodeStart(string) error + func (FakeDialogueHandler) Options(options []Option) (int, error) + func (FakeDialogueHandler) PrepareForLines([]string) error + type FuncMap map[string]interface + type Line struct + ID string + Substitutions []string + type MapVariableStorage map[string]interface + func (m MapVariableStorage) Clear() + func (m MapVariableStorage) GetValue(name string) (value interface{}, found bool) + func (m MapVariableStorage) SetValue(name string, value interface{}) + type Option struct + DestinationNode string + ID int + IsAvailable bool + Line Line + type StringTable struct + Language language.Tag + Table map[string]*StringTableRow + func LoadFiles(programPath, stringTablePath, langCode string) (*yarnpb.Program, *StringTable, error) + func LoadStringTableFile(stringTablePath, langCode string) (*StringTable, error) + func ReadStringTable(r io.Reader, langCode string) (*StringTable, error) + func (t *StringTable) Render(line Line) (*AttributedString, error) + type StringTableRow struct + File string + ID string + LineNumber int + Node string + Text string + func (r *StringTableRow) Render(substs []string, lang language.Tag) (*AttributedString, error) + type TestPlan struct + Step int + Steps []TestStep + StringTable *StringTable + func LoadTestPlanFile(testPlanPath string) (*TestPlan, error) + func ReadTestPlan(r io.Reader) (*TestPlan, error) + func (p *TestPlan) Command(command string) error + func (p *TestPlan) Complete() error + func (p *TestPlan) DialogueComplete() error + func (p *TestPlan) Line(line Line) error + func (p *TestPlan) Options(opts []Option) (int, error) + type TestStep struct + Contents string + Type string + func (s TestStep) String() string + type VariableStorage interface + Clear func() + GetValue func(name string) (value interface{}, ok bool) + SetValue func(name string, value interface{}) + type VirtualMachine struct + FuncMap FuncMap + Handler DialogueHandler + Program *yarnpb.Program + TraceLogf func(string, ...interface{}) + Vars VariableStorage + func (vm *VirtualMachine) Run(startNode string) error + func (vm *VirtualMachine) SetNode(name string) error