Documentation ¶
Overview ¶
Scripting commands to debug and test stories.
Index ¶
- Variables
- func Register(reg func(any))
- func SplitLines(str string) []string
- func Stringify(v rt.Value) (ret string)
- type DoNothing
- type DoNothingText
- type DoNothing_Slice
- type Expect
- type ExpectText
- type ExpectText_Slice
- type Expect_Slice
- type Fabricate
- type Fabricate_Slice
- type GreatExpectations
- type LogValue
- type LogValue_Slice
- type LoggingLevel
- type Note
- type Note_Slice
Constants ¶
This section is empty.
Variables ¶
var Stepper func(words string) error
a callback so fabricate can trigger a step of the parser; fabricate will error if this is nil/unset. ( see also: cmdcheck )
var Z_Types = typeinfo.TypeSet{ Name: "debug", Comment: []string{ "Scripting commands to debug and test stories.", }, Flow: z_flow_list, Str: z_str_list, Signatures: z_signatures, }
package listing of type data
var Zt_DoNothing typeinfo.Flow
do_nothing, a type of flow.
var Zt_Expect typeinfo.Flow
expect, a type of flow.
var Zt_ExpectText typeinfo.Flow
expect_text, a type of flow.
var Zt_Fabricate typeinfo.Flow
fabricate, a type of flow.
var Zt_LogValue typeinfo.Flow
log_value, a type of flow.
var Zt_LoggingLevel = typeinfo.Str{ Name: "logging_level", Options: []string{ "debug", "info", "warn", "error", }, Markup: map[string]any{ "--": "Used with [DebugLog].", }, }
logging_level, a type of str enum.
var Zt_Note typeinfo.Flow
note, a type of flow.
Functions ¶
func SplitLines ¶
separate a string into separate lines whenever a linefeed ( \n ) is detected.
Types ¶
type DoNothing ¶
A runtime command that does... nothing. ( Can be used to fill in branches ( ex. of if statements )
or rules which aren't supposed to do anything. )
func (*DoNothing) GetMarkup ¶
Implements typeinfo.Markup
type DoNothingText ¶ added in v0.24.6
type DoNothingText string
type DoNothing_Slice ¶
type DoNothing_Slice []DoNothing
Holds a slice of type DoNothing.
func (*DoNothing_Slice) Repeats ¶
func (op *DoNothing_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DoNothing.
func (*DoNothing_Slice) TypeInfo ¶
func (*DoNothing_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DoNothing.
type Expect ¶
Evaluate a boolean command and ensure it returns true.
func (*Expect) GetMarkup ¶
Implements typeinfo.Markup
type ExpectText ¶
Examine the most recent game output, and generate an error unless it matches the specified text.
func (*ExpectText) GetMarkup ¶
func (op *ExpectText) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
type ExpectText_Slice ¶
type ExpectText_Slice []ExpectText
Holds a slice of type ExpectText.
func (*ExpectText_Slice) Repeats ¶
func (op *ExpectText_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ExpectText.
func (*ExpectText_Slice) TypeInfo ¶
func (*ExpectText_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ExpectText.
type Expect_Slice ¶
type Expect_Slice []Expect
Holds a slice of type Expect.
func (*Expect_Slice) Repeats ¶
func (op *Expect_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Expect.
func (*Expect_Slice) TypeInfo ¶
func (*Expect_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Expect.
type Fabricate ¶
Process fake input as if the player had typed it themselves. Fabricate only works while running tests, and does nothing during normal game play. Multiple actions can be specified by separating them with semi-colons. For example:
Fabricate input: "s; jump; look"
func (*Fabricate) GetMarkup ¶
Implements typeinfo.Markup
type Fabricate_Slice ¶
type Fabricate_Slice []Fabricate
Holds a slice of type Fabricate.
func (*Fabricate_Slice) Repeats ¶
func (op *Fabricate_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Fabricate.
func (*Fabricate_Slice) TypeInfo ¶
func (*Fabricate_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Fabricate.
type GreatExpectations ¶
type GreatExpectations interface { // gets and resets the most recent game output GetAccumulatedOutput() []string }
an optional interface runtimes can implement for testing
type LogValue ¶ added in v0.24.6
type LogValue struct { LogLevel LoggingLevel Value rtti.Assignment Markup map[string]any `json:",omitempty"` }
Print a value that might be useful during development. It will be hidden from players in the final game.
func (*LogValue) GetMarkup ¶ added in v0.24.6
Implements typeinfo.Markup
type LogValue_Slice ¶ added in v0.24.6
type LogValue_Slice []LogValue
Holds a slice of type LogValue.
func (*LogValue_Slice) Repeats ¶ added in v0.24.6
func (op *LogValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of LogValue.
func (*LogValue_Slice) TypeInfo ¶ added in v0.24.6
func (*LogValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of LogValue.
type LoggingLevel ¶
type LoggingLevel int
LoggingLevel, a type of str enum.
const ( C_LoggingLevel_Debug LoggingLevel = iota C_LoggingLevel_Info C_LoggingLevel_Warn C_LoggingLevel_Error )
The enumerated values of LoggingLevel.
var LogLevel LoggingLevel = C_LoggingLevel_Debug
LogLevel controls how much debugging to print logs only at the named level and higher.
func MakeLoggingLevel ¶
func MakeLoggingLevel(str string) (ret LoggingLevel, okay bool)
func (LoggingLevel) String ¶
func (op LoggingLevel) String() (ret string)
type Note ¶ added in v0.24.6
type Note struct { Text rtti.TextEval LogLevel LoggingLevel Markup map[string]any `json:",omitempty"` }
Print a message that might be useful during development. It will be hidden from players in the final game.
func (*Note) GetMarkup ¶ added in v0.24.6
Implements typeinfo.Markup
type Note_Slice ¶ added in v0.24.6
type Note_Slice []Note
Holds a slice of type Note.
func (*Note_Slice) Repeats ¶ added in v0.24.6
func (op *Note_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of Note.
func (*Note_Slice) TypeInfo ¶ added in v0.24.6
func (*Note_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of Note.