format

package
v0.24.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Overview

Text printing and output control. The default Tapestry runtime will process printed text according to its [markup rules](https://pkg.go.dev/git.sr.ht/~ionous/tapestry/web/markup).

Index

Examples

Constants

This section is empty.

Variables

View Source
var Z_Types = typeinfo.TypeSet{
	Name: "format",
	Comment: []string{
		"Text printing and output control.",
		"The default Tapestry runtime will process printed text according to its [markup rules](https://pkg.go.dev/git.sr.ht/~ionous/tapestry/web/markup).",
	},

	Slot:       z_slot_list,
	Flow:       z_flow_list,
	Signatures: z_signatures,
}

package listing of type data

View Source
var Zt_BufferText typeinfo.Flow

buffer_text, a type of flow.

View Source
var Zt_Counter = typeinfo.Slot{
	Name: "counter",
	Markup: map[string]any{
		"--": "A slot used internally for generating unique names during weave.",
	},
}

counter, a type of slot.

View Source
var Zt_CycleText typeinfo.Flow

cycle_text, a type of flow.

View Source
var Zt_LineBreak typeinfo.Flow

line_break, a type of flow.

View Source
var Zt_MenuOptions typeinfo.Flow

menu_options, a type of flow.

View Source
var Zt_ParagraphBreak typeinfo.Flow

paragraph_break, a type of flow.

View Source
var Zt_PrintBrackets typeinfo.Flow

print_brackets, a type of flow.

View Source
var Zt_PrintCommas typeinfo.Flow

print_commas, a type of flow.

View Source
var Zt_PrintCount typeinfo.Flow

print_count, a type of flow.

View Source
var Zt_PrintMenu typeinfo.Flow

print_menu, a type of flow.

View Source
var Zt_PrintMenuChoice typeinfo.Flow

print_menu_choice, a type of flow.

View Source
var Zt_PrintNum typeinfo.Flow

print_num, a type of flow.

View Source
var Zt_PrintRow typeinfo.Flow

print_row, a type of flow.

View Source
var Zt_PrintRows typeinfo.Flow

print_rows, a type of flow.

View Source
var Zt_PrintText typeinfo.Flow

print_text, a type of flow.

View Source
var Zt_PrintWords typeinfo.Flow

print_words, a type of flow.

View Source
var Zt_SayActor typeinfo.Flow

say_actor, a type of flow.

View Source
var Zt_ShuffleText typeinfo.Flow

shuffle_text, a type of flow.

View Source
var Zt_SoftBreak typeinfo.Flow

soft_break, a type of flow.

View Source
var Zt_StoppingText typeinfo.Flow

stopping_text, a type of flow.

Functions

func Register added in v0.24.7

func Register(reg func(any))

gob like registration

Types

type BufferText

type BufferText struct {
	Exe    []rtti.Execute
	Markup map[string]any `json:",omitempty"`
}

Capture any and all text printed by the game, and return it as a single string of continuous text. New lines are stored as line feeds ('\n').

func (*BufferText) GetMarkup

func (op *BufferText) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*BufferText) GetText

func (op *BufferText) GetText(run rt.Runtime) (ret rt.Value, err error)

collect all text written during this function and return it as a value

func (*BufferText) TypeInfo

func (*BufferText) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type BufferText_Slice

type BufferText_Slice []BufferText

Holds a slice of type BufferText.

func (*BufferText_Slice) Repeats

func (op *BufferText_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of BufferText.

func (*BufferText_Slice) TypeInfo

func (*BufferText_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of BufferText.

type Counter

type Counter interface {
	GetInternalCounter() *string
}

A slot used internally for generating unique names during weave.

type Counter_Slot

type Counter_Slot struct{ Value Counter }

Holds a single slot.

func (*Counter_Slot) TypeInfo

func (*Counter_Slot) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a single slot.

type Counter_Slots

type Counter_Slots []Counter

Holds a slice of slots.

func (*Counter_Slots) Repeats

func (op *Counter_Slots) Repeats() bool

Implements typeinfo.Repeats for a slice of slots.

func (*Counter_Slots) TypeInfo

func (*Counter_Slots) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of slots.

type CycleText

type CycleText struct {
	Name   string
	Parts  []rtti.TextEval
	Markup map[string]any `json:",omitempty"`
}

Returns some text selected from a set of predefined values. When called multiple times, this returns each one of the values in their specified order, then it loops back to the first value again.

func (*CycleText) GetInternalCounter

func (op *CycleText) GetInternalCounter() *string

func (*CycleText) GetMarkup

func (op *CycleText) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*CycleText) GetText

func (op *CycleText) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*CycleText) TypeInfo

func (*CycleText) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type CycleText_Slice

type CycleText_Slice []CycleText

Holds a slice of type CycleText.

func (*CycleText_Slice) Repeats

func (op *CycleText_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of CycleText.

func (*CycleText_Slice) TypeInfo

func (*CycleText_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of CycleText.

type LineBreak

type LineBreak struct {
	Markup map[string]any `json:",omitempty"`
}

Start a new line. See also the <br> markup.

func (*LineBreak) Execute

func (op *LineBreak) Execute(run rt.Runtime) (_ error)

func (*LineBreak) GetMarkup

func (op *LineBreak) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*LineBreak) TypeInfo

func (*LineBreak) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type LineBreak_Slice

type LineBreak_Slice []LineBreak

Holds a slice of type LineBreak.

func (*LineBreak_Slice) Repeats

func (op *LineBreak_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of LineBreak.

func (*LineBreak_Slice) TypeInfo

func (*LineBreak_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of LineBreak.

type MenuData struct {
	Action string
	UseList,
	UseNumbers bool
	Choices []string
}
var CurrentMenu MenuData

alt: could collect into a private member of print menu choices alt: the parser could examine the text output and capture the choices. ( examining the ol / ul for numbers i suppose )

func GetMenuData added in v0.24.8

func GetMenuData(run rt.Runtime, name string, op *MenuOptions) (ret MenuData, err error)
func (pt *MenuData) Match(w string) (ret string, okay bool)
type MenuOptions struct {
	ShowList    rtti.BoolEval
	ShowNumbers rtti.BoolEval
	Markup      map[string]any `json:",omitempty"`
}

Settings to control menu presentation.

func (op *MenuOptions) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*MenuOptions) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type MenuOptions_Slice []MenuOptions

Holds a slice of type MenuOptions.

func (op *MenuOptions_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of MenuOptions.

func (*MenuOptions_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of MenuOptions.

type ParagraphBreak

type ParagraphBreak struct {
	Markup map[string]any `json:",omitempty"`
}

Add a single blank line ( unless a blank line was just written ). See also the <p> markup.

func (*ParagraphBreak) Execute

func (op *ParagraphBreak) Execute(run rt.Runtime) (_ error)

func (*ParagraphBreak) GetMarkup

func (op *ParagraphBreak) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*ParagraphBreak) TypeInfo

func (*ParagraphBreak) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type ParagraphBreak_Slice

type ParagraphBreak_Slice []ParagraphBreak

Holds a slice of type ParagraphBreak.

func (*ParagraphBreak_Slice) Repeats

func (op *ParagraphBreak_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of ParagraphBreak.

func (*ParagraphBreak_Slice) TypeInfo

func (*ParagraphBreak_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of ParagraphBreak.

type PrintBrackets

type PrintBrackets struct {
	Exe    []rtti.Execute
	Markup map[string]any `json:",omitempty"`
}

Collect printed text and surround the output with parenthesis '()'. If no text is printed, no parentheses are printed.

Example
package main

import (
	"os"

	"git.sr.ht/~ionous/tapestry/dl/format"
	"git.sr.ht/~ionous/tapestry/dl/literal"
	"git.sr.ht/~ionous/tapestry/rt"
	"git.sr.ht/~ionous/tapestry/rt/safe"
	"git.sr.ht/~ionous/tapestry/rt/writer"
	"git.sr.ht/~ionous/tapestry/test/testutil"
)

var helloThereWorld = []rt.Execute{
	&format.PrintText{Text: literal.T("hello")},
	&format.PrintText{Text: literal.T("there")},
	&format.PrintText{Text: literal.T("world")},
}

func main() {
	var run sayTester
	run.SetWriter(os.Stdout)
	if e := safe.WriteText(&run, &format.PrintBrackets{Exe: helloThereWorld}); e != nil {
		panic(e)
	}
}

type baseRuntime struct {
	testutil.PanicRuntime
}
type sayTester struct {
	baseRuntime
	writer.Sink
}
Output:

(hello there world)

func (*PrintBrackets) Execute

func (op *PrintBrackets) Execute(run rt.Runtime) error

func (*PrintBrackets) GetMarkup

func (op *PrintBrackets) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintBrackets) GetText

func (op *PrintBrackets) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintBrackets) TypeInfo

func (*PrintBrackets) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintBrackets_Slice

type PrintBrackets_Slice []PrintBrackets

Holds a slice of type PrintBrackets.

func (*PrintBrackets_Slice) Repeats

func (op *PrintBrackets_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintBrackets.

func (*PrintBrackets_Slice) TypeInfo

func (*PrintBrackets_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintBrackets.

type PrintCommas

type PrintCommas struct {
	Exe    []rtti.Execute
	Markup map[string]any `json:",omitempty"`
}

Separates words with commas, and 'and'.

Example
package main

import (
	"os"

	"git.sr.ht/~ionous/tapestry/dl/format"
	"git.sr.ht/~ionous/tapestry/dl/literal"
	"git.sr.ht/~ionous/tapestry/rt"
	"git.sr.ht/~ionous/tapestry/rt/safe"
	"git.sr.ht/~ionous/tapestry/rt/writer"
	"git.sr.ht/~ionous/tapestry/test/testutil"
)

var helloThereWorld = []rt.Execute{
	&format.PrintText{Text: literal.T("hello")},
	&format.PrintText{Text: literal.T("there")},
	&format.PrintText{Text: literal.T("world")},
}

func main() {
	var run sayTester
	run.SetWriter(os.Stdout)
	if e := safe.WriteText(&run, &format.PrintCommas{Exe: helloThereWorld}); e != nil {
		panic(e)
	}
}

type baseRuntime struct {
	testutil.PanicRuntime
}
type sayTester struct {
	baseRuntime
	writer.Sink
}
Output:

hello, there, and world

func (*PrintCommas) Execute

func (op *PrintCommas) Execute(run rt.Runtime) error

func (*PrintCommas) GetMarkup

func (op *PrintCommas) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintCommas) GetText

func (op *PrintCommas) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintCommas) TypeInfo

func (*PrintCommas) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintCommas_Slice

type PrintCommas_Slice []PrintCommas

Holds a slice of type PrintCommas.

func (*PrintCommas_Slice) Repeats

func (op *PrintCommas_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintCommas.

func (*PrintCommas_Slice) TypeInfo

func (*PrintCommas_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintCommas.

type PrintCount

type PrintCount struct {
	Num    rtti.NumEval
	Markup map[string]any `json:",omitempty"`
}

Express an integer in plain english ( aka a cardinal number ). For example, given the number `12` return the text "tweleve". It converts floating point numbers to integer by truncating: given `1.6`, it returns "one".

The [story.Execute] version prints the text for the player.

Example
var run sayTester
run.SetWriter(os.Stdout)
if e := safe.WriteText(&run, &PrintCount{Num: literal.F(213)}); e != nil {
	panic(e)
}
Output:

two hundred thirteen

func (*PrintCount) Execute

func (op *PrintCount) Execute(run rt.Runtime) (err error)

func (*PrintCount) GetMarkup

func (op *PrintCount) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintCount) GetText

func (op *PrintCount) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintCount) TypeInfo

func (*PrintCount) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintCount_Slice

type PrintCount_Slice []PrintCount

Holds a slice of type PrintCount.

func (*PrintCount_Slice) Repeats

func (op *PrintCount_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintCount.

func (*PrintCount_Slice) TypeInfo

func (*PrintCount_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintCount.

type PrintMenu added in v0.24.8

type PrintMenu struct {
	ActionName  rtti.TextEval
	MenuOptions *MenuOptions
	Exe         []rtti.Execute
	Markup      map[string]any `json:",omitempty"`
}

Starts a menu. Individual menu options are printed with `Print choice:`. It's considered an error to try to print multiple menus in single turn. Menus

func (*PrintMenu) Execute added in v0.24.8

func (op *PrintMenu) Execute(run rt.Runtime) (err error)

func (*PrintMenu) GetMarkup added in v0.24.8

func (op *PrintMenu) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintMenu) TypeInfo added in v0.24.8

func (*PrintMenu) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintMenuChoice added in v0.24.8

type PrintMenuChoice struct {
	Label   rtti.TextEval
	Content rtti.TextEval
	Markup  map[string]any `json:",omitempty"`
}

Prints an individual menu choice. It's considered an error to try to print a menu choice other than during `Print menu:choices:`.

func (*PrintMenuChoice) Execute added in v0.24.8

func (op *PrintMenuChoice) Execute(run rt.Runtime) (err error)

func (*PrintMenuChoice) GetMarkup added in v0.24.8

func (op *PrintMenuChoice) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintMenuChoice) TypeInfo added in v0.24.8

func (*PrintMenuChoice) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintMenuChoice_Slice added in v0.24.8

type PrintMenuChoice_Slice []PrintMenuChoice

Holds a slice of type PrintMenuChoice.

func (*PrintMenuChoice_Slice) Repeats added in v0.24.8

func (op *PrintMenuChoice_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintMenuChoice.

func (*PrintMenuChoice_Slice) TypeInfo added in v0.24.8

func (*PrintMenuChoice_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintMenuChoice.

type PrintMenu_Slice added in v0.24.8

type PrintMenu_Slice []PrintMenu

Holds a slice of type PrintMenu.

func (*PrintMenu_Slice) Repeats added in v0.24.8

func (op *PrintMenu_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintMenu.

func (*PrintMenu_Slice) TypeInfo added in v0.24.8

func (*PrintMenu_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintMenu.

type PrintNum

type PrintNum struct {
	Num    rtti.NumEval
	Markup map[string]any `json:",omitempty"`
}

Express a number using digits. For example, given the number `12` return the text "12".

The [story.Execute] version prints the text for the player.

Example
var run sayTester
run.SetWriter(os.Stdout)
if e := safe.WriteText(&run, &PrintNum{Num: literal.F(213)}); e != nil {
	panic(e)
}
Output:

213

func (*PrintNum) Execute

func (op *PrintNum) Execute(run rt.Runtime) (err error)

func (*PrintNum) GetMarkup

func (op *PrintNum) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintNum) GetText

func (op *PrintNum) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintNum) TypeInfo

func (*PrintNum) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintNum_Slice

type PrintNum_Slice []PrintNum

Holds a slice of type PrintNum.

func (*PrintNum_Slice) Repeats

func (op *PrintNum_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintNum.

func (*PrintNum_Slice) TypeInfo

func (*PrintNum_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintNum.

type PrintRow

type PrintRow struct {
	Exe    []rtti.Execute
	Markup map[string]any `json:",omitempty"`
}

Group text into a single line <li> as part of a list of lines. See also: `Print rows:`.

func (*PrintRow) Execute

func (op *PrintRow) Execute(run rt.Runtime) (err error)

func (*PrintRow) GetMarkup

func (op *PrintRow) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintRow) GetText

func (op *PrintRow) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintRow) TypeInfo

func (*PrintRow) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintRow_Slice

type PrintRow_Slice []PrintRow

Holds a slice of type PrintRow.

func (*PrintRow_Slice) Repeats

func (op *PrintRow_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintRow.

func (*PrintRow_Slice) TypeInfo

func (*PrintRow_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintRow.

type PrintRows

type PrintRows struct {
	Exe    []rtti.Execute
	Markup map[string]any `json:",omitempty"`
}

Group text into an unordered list <ul>.

func (*PrintRows) Execute

func (op *PrintRows) Execute(run rt.Runtime) (err error)

func (*PrintRows) GetMarkup

func (op *PrintRows) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintRows) GetText

func (op *PrintRows) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintRows) TypeInfo

func (*PrintRows) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintRows_Slice

type PrintRows_Slice []PrintRows

Holds a slice of type PrintRows.

func (*PrintRows_Slice) Repeats

func (op *PrintRows_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintRows.

func (*PrintRows_Slice) TypeInfo

func (*PrintRows_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintRows.

type PrintText

type PrintText struct {
	Text   rtti.TextEval
	Markup map[string]any `json:",omitempty"`
}

Display some text to the player. The default runtime will format the text according to the rules specified by the Tapestry markup package: https://pkg.go.dev/git.sr.ht/~ionous/tapestry/web/markup

func (*PrintText) Execute

func (op *PrintText) Execute(run rt.Runtime) (err error)

Execute writes text to the runtime's current writer.

func (*PrintText) GetMarkup

func (op *PrintText) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintText) TypeInfo

func (*PrintText) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintText_Slice

type PrintText_Slice []PrintText

Holds a slice of type PrintText.

func (*PrintText_Slice) Repeats

func (op *PrintText_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintText.

func (*PrintText_Slice) TypeInfo

func (*PrintText_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintText.

type PrintWords

type PrintWords struct {
	Separator rtti.TextEval
	Exe       []rtti.Execute
	Markup    map[string]any `json:",omitempty"`
}

Collect printed text and separate that text by single spaces.

Example
package main

import (
	"os"

	"git.sr.ht/~ionous/tapestry/dl/format"
	"git.sr.ht/~ionous/tapestry/dl/literal"
	"git.sr.ht/~ionous/tapestry/rt"
	"git.sr.ht/~ionous/tapestry/rt/safe"
	"git.sr.ht/~ionous/tapestry/rt/writer"
	"git.sr.ht/~ionous/tapestry/test/testutil"
)

var helloThereWorld = []rt.Execute{
	&format.PrintText{Text: literal.T("hello")},
	&format.PrintText{Text: literal.T("there")},
	&format.PrintText{Text: literal.T("world")},
}

func main() {
	var run sayTester
	run.SetWriter(os.Stdout)
	if e := safe.WriteText(&run, &format.PrintWords{Exe: helloThereWorld}); e != nil {
		panic(e)
	}
}

type baseRuntime struct {
	testutil.PanicRuntime
}
type sayTester struct {
	baseRuntime
	writer.Sink
}
Output:

hello there world

func (*PrintWords) Execute

func (op *PrintWords) Execute(run rt.Runtime) error

func (*PrintWords) GetMarkup

func (op *PrintWords) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintWords) GetText

func (op *PrintWords) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*PrintWords) TypeInfo

func (*PrintWords) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintWords_Slice

type PrintWords_Slice []PrintWords

Holds a slice of type PrintWords.

func (*PrintWords_Slice) Repeats

func (op *PrintWords_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintWords.

func (*PrintWords_Slice) TypeInfo

func (*PrintWords_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintWords.

type SayActor added in v0.24.8

type SayActor struct {
	Actor  rtti.TextEval
	Text   rtti.TextEval
	Markup map[string]any `json:",omitempty"`
}

Have a particular actor say some text to the player. The text can contain a "template" which holds commands executed at runtime. See the Tapestry guide for more information.

func (*SayActor) Execute added in v0.24.8

func (op *SayActor) Execute(run rt.Runtime) (err error)

func (*SayActor) GetMarkup added in v0.24.8

func (op *SayActor) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*SayActor) TypeInfo added in v0.24.8

func (*SayActor) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type SayActor_Slice added in v0.24.8

type SayActor_Slice []SayActor

Holds a slice of type SayActor.

func (*SayActor_Slice) Repeats added in v0.24.8

func (op *SayActor_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of SayActor.

func (*SayActor_Slice) TypeInfo added in v0.24.8

func (*SayActor_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of SayActor.

type ShuffleText

type ShuffleText struct {
	Name  string
	Parts []rtti.TextEval

	Markup map[string]any `json:",omitempty"`
	// contains filtered or unexported fields
}

Returns some text selected from a set of predefined values. When called multiple times, this returns each one of the values in a randomized order. After returning all of the available options, it begins again with a new ordering.

func (*ShuffleText) GetInternalCounter

func (op *ShuffleText) GetInternalCounter() *string

func (*ShuffleText) GetMarkup

func (op *ShuffleText) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*ShuffleText) GetText

func (op *ShuffleText) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*ShuffleText) TypeInfo

func (*ShuffleText) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type ShuffleText_Slice

type ShuffleText_Slice []ShuffleText

Holds a slice of type ShuffleText.

func (*ShuffleText_Slice) Repeats

func (op *ShuffleText_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of ShuffleText.

func (*ShuffleText_Slice) TypeInfo

func (*ShuffleText_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of ShuffleText.

type Shuffler

type Shuffler struct {
	// contains filtered or unexported fields
}

type SoftBreak

type SoftBreak struct {
	Markup map[string]any `json:",omitempty"`
}

Start a new line ( if not already at a new line ). See also the <wbr> markup.

func (*SoftBreak) Execute

func (op *SoftBreak) Execute(run rt.Runtime) (_ error)

func (*SoftBreak) GetMarkup

func (op *SoftBreak) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*SoftBreak) TypeInfo

func (*SoftBreak) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type SoftBreak_Slice

type SoftBreak_Slice []SoftBreak

Holds a slice of type SoftBreak.

func (*SoftBreak_Slice) Repeats

func (op *SoftBreak_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of SoftBreak.

func (*SoftBreak_Slice) TypeInfo

func (*SoftBreak_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of SoftBreak.

type StoppingText

type StoppingText struct {
	Name   string
	Parts  []rtti.TextEval
	Markup map[string]any `json:",omitempty"`
}

Returns some text selected from a set of predefined values. When called multiple times, this returns each of its inputs in turn. After returning all of the available options, it sticks to using the last option.

As a special case, if there was only ever one option: it returns that option followed by nothing ( the empty string ) forever after.

func (*StoppingText) GetInternalCounter

func (op *StoppingText) GetInternalCounter() *string

func (*StoppingText) GetMarkup

func (op *StoppingText) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*StoppingText) GetText

func (op *StoppingText) GetText(run rt.Runtime) (ret rt.Value, err error)

func (*StoppingText) TypeInfo

func (*StoppingText) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type StoppingText_Slice

type StoppingText_Slice []StoppingText

Holds a slice of type StoppingText.

func (*StoppingText_Slice) Repeats

func (op *StoppingText_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of StoppingText.

func (*StoppingText_Slice) TypeInfo

func (*StoppingText_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of StoppingText.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL