Documentation ¶
Overview ¶
Game world modeling using Tapestry commands. These commands include the description of scenes, kinds of objects, specific nouns and their properties, the placement and relation between nouns, and so on.
Most authors will probably prefer the "jess" plain English style of modeling over these more explicit commands. However, there are some commands -- like defining scenes -- which don't have a corollary within jess.
Index ¶
- Variables
- func Decode(out *StoryFile, msg map[string]any) error
- func DecodeMessage(out typeinfo.Instance, msg map[string]any) error
- func DecodePattern(dec *decode.Decoder, slot *typeinfo.Slot, msg compact.Message) (ret typeinfo.Instance, err error)
- func Encode(file *StoryFile) (ret any, err error)
- func NewDecoder() *decode.Decoder
- func Weave(cat *weave.Catalog, all []StoryStatement) (err error)
- type AspectField
- type AspectField_Slice
- type BoolField
- type BoolField_Slice
- type CountOf
- type CountOf_Slice
- type DeclareStatement
- type DeclareStatement_Slice
- type DefineAction
- type DefineAction_Slice
- type DefineAlias
- type DefineAlias_Slice
- type DefineFields
- type DefineFields_Slice
- type DefineKind
- type DefineKindRule
- type DefineKindRule_Slice
- type DefineKind_Slice
- type DefineLeadingGrammar
- type DefineLeadingGrammar_Slice
- type DefineNamedGrammar
- type DefineNamedGrammar_Slice
- type DefineNounKind
- type DefineNounKind_Slice
- type DefineNounRule
- type DefineNounRule_Slice
- type DefineNounStates
- type DefineNounStates_Slice
- type DefineNounValue
- type DefineNounValue_Slice
- type DefinePattern
- type DefinePatternProvides
- type DefinePatternProvides_Slice
- type DefinePattern_Slice
- type DefinePlural
- type DefinePlural_Slice
- type DefineRelation
- type DefineRelation_Slice
- type DefineRelatives
- type DefineRelatives_Slice
- type DefineRule
- type DefineRule_Slice
- type DefineScene
- type DefineScene_Slice
- type DefineState
- type DefineState_Slice
- type DefineTest
- type DefineTest_Slice
- type FieldDefinition
- type FieldDefinition_Slot
- type FieldDefinition_Slots
- type JessMatches
- type NothingField
- type NothingField_Slice
- type NumField
- type NumField_Slice
- type NumListField
- type NumListField_Slice
- type PostImport
- type PreImport
- type RecordField
- type RecordField_Slice
- type RecordListField
- type RecordListField_Slice
- type RelationCardinality
- type SayResponse
- type SayResponse_Slice
- type SayTemplate
- type SayTemplate_Slice
- type StoryFile
- type StoryFile_Slice
- type StoryNote
- type StoryNote_Slice
- type StoryStatement
- type StoryStatement_Slot
- type StoryStatement_Slots
- type TextField
- type TextField_Slice
- type TextListField
- type TextListField_Slice
Constants ¶
This section is empty.
Variables ¶
var AllSignatures = append( tapestry.AllSignatures, Z_Types.Signatures, )
var Z_Types = typeinfo.TypeSet{ Name: "story", Comment: []string{ "Game world modeling using Tapestry commands. These commands include the description of scenes, kinds of objects, specific nouns and their properties, the placement and relation between nouns, and so on.", "", "Most authors will probably prefer the \"jess\" plain English style of modeling over these more explicit commands. However, there are some commands -- like defining scenes -- which don't have a corollary within jess.", }, Slot: z_slot_list, Flow: z_flow_list, Str: z_str_list, Signatures: z_signatures, }
package listing of type data
var Zt_AspectField typeinfo.Flow
aspect_field, a type of flow.
var Zt_BoolField typeinfo.Flow
bool_field, a type of flow.
var Zt_CountOf typeinfo.Flow
count_of, a type of flow.
var Zt_DeclareStatement typeinfo.Flow
declare_statement, a type of flow.
var Zt_DefineAction typeinfo.Flow
define_action, a type of flow.
var Zt_DefineAlias typeinfo.Flow
define_alias, a type of flow.
var Zt_DefineFields typeinfo.Flow
define_fields, a type of flow.
var Zt_DefineKind typeinfo.Flow
define_kind, a type of flow.
var Zt_DefineKindRule typeinfo.Flow
define_kind_rule, a type of flow.
var Zt_DefineLeadingGrammar typeinfo.Flow
define_leading_grammar, a type of flow.
var Zt_DefineNamedGrammar typeinfo.Flow
define_named_grammar, a type of flow.
var Zt_DefineNounKind typeinfo.Flow
define_noun_kind, a type of flow.
var Zt_DefineNounRule typeinfo.Flow
define_noun_rule, a type of flow.
var Zt_DefineNounStates typeinfo.Flow
define_noun_states, a type of flow.
var Zt_DefineNounValue typeinfo.Flow
define_noun_value, a type of flow.
var Zt_DefinePattern typeinfo.Flow
define_pattern, a type of flow.
var Zt_DefinePatternProvides typeinfo.Flow
define_pattern_provides, a type of flow.
var Zt_DefinePlural typeinfo.Flow
define_plural, a type of flow.
var Zt_DefineRelation typeinfo.Flow
define_relation, a type of flow.
var Zt_DefineRelatives typeinfo.Flow
define_relatives, a type of flow.
var Zt_DefineRule typeinfo.Flow
define_rule, a type of flow.
var Zt_DefineScene typeinfo.Flow
define_scene, a type of flow.
var Zt_DefineState typeinfo.Flow
define_state, a type of flow.
var Zt_DefineTest typeinfo.Flow
define_test, a type of flow.
var Zt_FieldDefinition = typeinfo.Slot{ Name: "field_definition", Markup: map[string]any{ "comment": "Describe the members of kinds, records, patterns, and so on.", }, }
field_definition, a type of slot.
var Zt_NothingField typeinfo.Flow
nothing_field, a type of flow.
var Zt_NumField typeinfo.Flow
num_field, a type of flow.
var Zt_NumListField typeinfo.Flow
num_list_field, a type of flow.
var Zt_RecordField typeinfo.Flow
record_field, a type of flow.
var Zt_RecordListField typeinfo.Flow
record_list_field, a type of flow.
var Zt_RelationCardinality = typeinfo.Str{ Name: "relation_cardinality", Options: []string{ "one_to_one", "one_to_many", "many_to_one", "many_to_many", }, Markup: map[string]any{ "comment": "Used as part of [DefineRelation] to declare a new kind of relationship between nouns.", }, }
relation_cardinality, a type of str enum.
var Zt_SayResponse typeinfo.Flow
say_response, a type of flow.
var Zt_SayTemplate typeinfo.Flow
say_template, a type of flow.
var Zt_StoryFile typeinfo.Flow
story_file, a type of flow.
var Zt_StoryNote typeinfo.Flow
story_note, a type of flow.
var Zt_StoryStatement = typeinfo.Slot{ Name: "story_statement", Markup: map[string]any{ "blockly-color": "VARIABLES_HUE", "blockly-stack": true, "comment": "Story commands model the game world. Story files ( .tell ) are essentially just a list of story commands. Certain story commands specify slots for other types of commands including those for running scripts, parsing the player's input, and more.", }, }
story_statement, a type of slot.
var Zt_TextField typeinfo.Flow
text_field, a type of flow.
var Zt_TextListField typeinfo.Flow
text_list_field, a type of flow.
Functions ¶
func DecodeMessage ¶
Create a story dl from native maps and slices.
func DecodePattern ¶
func NewDecoder ¶
Types ¶
type AspectField ¶
A field containing a set of states. Aspects are defined using the {"Define state:names:"} command.
func (*AspectField) GetFieldInfo ¶
func (op *AspectField) GetFieldInfo(run rt.Runtime) (ret mdl.FieldInfo)
func (*AspectField) GetMarkup ¶
func (op *AspectField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*AspectField) TypeInfo ¶
func (*AspectField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type AspectField_Slice ¶
type AspectField_Slice []AspectField
Holds a slice of type AspectField.
func (*AspectField_Slice) Repeats ¶
func (op *AspectField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of AspectField.
func (*AspectField_Slice) TypeInfo ¶
func (*AspectField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of AspectField.
type BoolField ¶
A field containing a boolean ( true/false ) value. As a special case, when used to define a boolean field in a kind, the boolean becomes a state set consisting of the state and its opposite. For instance, a boolean field called "reasonable" generates a set called "reasonable status" and the states "reasonable" and "not reasonable."
func (*BoolField) GetMarkup ¶
Implements typeinfo.Markup
type BoolField_Slice ¶
type BoolField_Slice []BoolField
Holds a slice of type BoolField.
func (*BoolField_Slice) Repeats ¶
func (op *BoolField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of BoolField.
func (*BoolField_Slice) TypeInfo ¶
func (*BoolField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of BoolField.
type CountOf ¶
A guard which returns true based on a counter. Counters start at zero and are incremented every time the guard is checked.
func (*CountOf) GetMarkup ¶
Implements typeinfo.Markup
type CountOf_Slice ¶
type CountOf_Slice []CountOf
Holds a slice of type CountOf.
func (*CountOf_Slice) Repeats ¶
func (op *CountOf_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of CountOf.
func (*CountOf_Slice) TypeInfo ¶
func (*CountOf_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of CountOf.
type DeclareStatement ¶
type DeclareStatement struct { Text rtti.TextEval Assign rtti.Assignment Matches JessMatches Markup map[string]any }
Used internally to contain the plain-text sections of .tell documents. Contains English-like definitions of nouns, kinds, and their relatives.
func (*DeclareStatement) GetMarkup ¶
func (op *DeclareStatement) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DeclareStatement) TypeInfo ¶
func (*DeclareStatement) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DeclareStatement_Slice ¶
type DeclareStatement_Slice []DeclareStatement
Holds a slice of type DeclareStatement.
func (*DeclareStatement_Slice) Repeats ¶
func (op *DeclareStatement_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DeclareStatement.
func (*DeclareStatement_Slice) TypeInfo ¶
func (*DeclareStatement_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DeclareStatement.
type DefineAction ¶
type DefineAction struct { PatternName rtti.TextEval Requires []FieldDefinition Provides []FieldDefinition Markup map[string]any }
Defines an in-game behavior that can be triggered by an actor. Actions are a special kind of pattern, and like patterns use "rules" to define and customize their behavior. The shared library includes many common actions including things like moving from room to room, examining something, taking or dropping items, and so on. See the Tapestry guide for more information.
func (*DefineAction) GetMarkup ¶
func (op *DefineAction) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineAction) TypeInfo ¶
func (*DefineAction) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineAction_Slice ¶
type DefineAction_Slice []DefineAction
Holds a slice of type DefineAction.
func (*DefineAction_Slice) Repeats ¶
func (op *DefineAction_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineAction.
func (*DefineAction_Slice) TypeInfo ¶
func (*DefineAction_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineAction.
type DefineAlias ¶
Interpret a name typed by the player as some existing noun. For example, if there is a noun called "the book", the story could define an alias so that "tome" also means the book.
func (*DefineAlias) GetMarkup ¶
func (op *DefineAlias) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineAlias) TypeInfo ¶
func (*DefineAlias) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineAlias_Slice ¶
type DefineAlias_Slice []DefineAlias
Holds a slice of type DefineAlias.
func (*DefineAlias_Slice) Repeats ¶
func (op *DefineAlias_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineAlias.
func (*DefineAlias_Slice) TypeInfo ¶
func (*DefineAlias_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineAlias.
type DefineFields ¶
type DefineFields struct { KindName rtti.TextEval FieldNames []FieldDefinition Markup map[string]any }
Adds properties to an existing kind. This command is similar to a sentence like: "Things have some text called a description."
func (*DefineFields) GetMarkup ¶
func (op *DefineFields) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineFields) TypeInfo ¶
func (*DefineFields) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineFields_Slice ¶
type DefineFields_Slice []DefineFields
Holds a slice of type DefineFields.
func (*DefineFields_Slice) Repeats ¶
func (op *DefineFields_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineFields.
func (*DefineFields_Slice) TypeInfo ¶
func (*DefineFields_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineFields.
type DefineKind ¶ added in v0.24.6
type DefineKind struct { KindName rtti.TextEval AncestorKindName rtti.TextEval Markup map[string]any }
Defines a new kind: a set of properties used by game objects. This command is similar to a sentence like: "Doors are a kind of opener."
func (*DefineKind) GetMarkup ¶ added in v0.24.6
func (op *DefineKind) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineKind) TypeInfo ¶ added in v0.24.6
func (*DefineKind) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineKindRule ¶ added in v0.24.6
type DefineKindRule struct { KindName rtti.TextEval RuleTiming rtti.TextEval RuleName rtti.TextEval Exe []rtti.Execute Markup map[string]any }
Adds an "event listener" which only runs if the target of the triggered action a noun of the specified kind. See DefineRule for more information.
func (*DefineKindRule) GetMarkup ¶ added in v0.24.6
func (op *DefineKindRule) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineKindRule) TypeInfo ¶ added in v0.24.6
func (*DefineKindRule) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineKindRule_Slice ¶ added in v0.24.6
type DefineKindRule_Slice []DefineKindRule
Holds a slice of type DefineKindRule.
func (*DefineKindRule_Slice) Repeats ¶ added in v0.24.6
func (op *DefineKindRule_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineKindRule.
func (*DefineKindRule_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineKindRule_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineKindRule.
type DefineKind_Slice ¶ added in v0.24.6
type DefineKind_Slice []DefineKind
Holds a slice of type DefineKind.
func (*DefineKind_Slice) Repeats ¶ added in v0.24.6
func (op *DefineKind_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineKind.
func (*DefineKind_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineKind_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineKind.
type DefineLeadingGrammar ¶
type DefineLeadingGrammar struct { Lede []string Scans []grammar.ScannerMaker Markup map[string]any }
Creates a grammar used to parse player input.
func (*DefineLeadingGrammar) GetMarkup ¶
func (op *DefineLeadingGrammar) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineLeadingGrammar) TypeInfo ¶
func (*DefineLeadingGrammar) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineLeadingGrammar_Slice ¶
type DefineLeadingGrammar_Slice []DefineLeadingGrammar
Holds a slice of type DefineLeadingGrammar.
func (*DefineLeadingGrammar_Slice) Repeats ¶
func (op *DefineLeadingGrammar_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineLeadingGrammar.
func (*DefineLeadingGrammar_Slice) TypeInfo ¶
func (*DefineLeadingGrammar_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineLeadingGrammar.
type DefineNamedGrammar ¶
type DefineNamedGrammar struct { Name string Scans []grammar.ScannerMaker Markup map[string]any }
Creates a grammar to parse player input that can be referenced in other grammars. It can also be used for grammars that need more flexibility in matching the initial words of a sentence ( because {"Interpret:with:"} depends on a set of fixed words. )
func (*DefineNamedGrammar) GetMarkup ¶
func (op *DefineNamedGrammar) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineNamedGrammar) TypeInfo ¶
func (*DefineNamedGrammar) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineNamedGrammar_Slice ¶
type DefineNamedGrammar_Slice []DefineNamedGrammar
Holds a slice of type DefineNamedGrammar.
func (*DefineNamedGrammar_Slice) Repeats ¶
func (op *DefineNamedGrammar_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineNamedGrammar.
func (*DefineNamedGrammar_Slice) TypeInfo ¶
func (*DefineNamedGrammar_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineNamedGrammar.
type DefineNounKind ¶ added in v0.24.6
Ensures that a noun of the specified name and kind exists in the world.
func (*DefineNounKind) GetMarkup ¶ added in v0.24.6
func (op *DefineNounKind) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineNounKind) TypeInfo ¶ added in v0.24.6
func (*DefineNounKind) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineNounKind_Slice ¶ added in v0.24.6
type DefineNounKind_Slice []DefineNounKind
Holds a slice of type DefineNounKind.
func (*DefineNounKind_Slice) Repeats ¶ added in v0.24.6
func (op *DefineNounKind_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineNounKind.
func (*DefineNounKind_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineNounKind_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineNounKind.
type DefineNounRule ¶ added in v0.24.6
type DefineNounRule struct { NounName rtti.TextEval RuleTiming rtti.TextEval RuleName rtti.TextEval Exe []rtti.Execute Markup map[string]any }
Adds an "event listener" which only runs if the target of the triggered action is the specified noun. See DefineRule for more information.
func (*DefineNounRule) GetMarkup ¶ added in v0.24.6
func (op *DefineNounRule) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineNounRule) TypeInfo ¶ added in v0.24.6
func (*DefineNounRule) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineNounRule_Slice ¶ added in v0.24.6
type DefineNounRule_Slice []DefineNounRule
Holds a slice of type DefineNounRule.
func (*DefineNounRule_Slice) Repeats ¶ added in v0.24.6
func (op *DefineNounRule_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineNounRule.
func (*DefineNounRule_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineNounRule_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineNounRule.
type DefineNounStates ¶ added in v0.24.6
type DefineNounStates struct { NounName rtti.TextEval StateNames rtti.TextListEval Markup map[string]any }
Assigns one or more initial states to a existing noun.
func (*DefineNounStates) GetMarkup ¶ added in v0.24.6
func (op *DefineNounStates) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineNounStates) TypeInfo ¶ added in v0.24.6
func (*DefineNounStates) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineNounStates_Slice ¶ added in v0.24.6
type DefineNounStates_Slice []DefineNounStates
Holds a slice of type DefineNounStates.
func (*DefineNounStates_Slice) Repeats ¶ added in v0.24.6
func (op *DefineNounStates_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineNounStates.
func (*DefineNounStates_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineNounStates_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineNounStates.
type DefineNounValue ¶ added in v0.24.6
type DefineNounValue struct { NounName rtti.TextEval FieldName rtti.TextEval Value rtti.Assignment Markup map[string]any }
Assigns an initial value to a existing noun.
func (*DefineNounValue) GetMarkup ¶ added in v0.24.6
func (op *DefineNounValue) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineNounValue) TypeInfo ¶ added in v0.24.6
func (*DefineNounValue) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineNounValue_Slice ¶ added in v0.24.6
type DefineNounValue_Slice []DefineNounValue
Holds a slice of type DefineNounValue.
func (*DefineNounValue_Slice) Repeats ¶ added in v0.24.6
func (op *DefineNounValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineNounValue.
func (*DefineNounValue_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineNounValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineNounValue.
type DefinePattern ¶
type DefinePattern struct { PatternName rtti.TextEval Requires []FieldDefinition Provides []FieldDefinition Exe []rtti.Execute Markup map[string]any }
Declares a new pattern. A pattern is a set of author defined rules used at runtime to either change the game world, or to provide information about it. Patterns are the Tapestry equivalent of functions.
func (*DefinePattern) GetMarkup ¶
func (op *DefinePattern) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefinePattern) TypeInfo ¶
func (*DefinePattern) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefinePatternProvides ¶ added in v0.24.6
type DefinePatternProvides struct { PatternName rtti.TextEval Provides []FieldDefinition Markup map[string]any }
Adds one or more local variable to an existing pattern.
func (*DefinePatternProvides) GetMarkup ¶ added in v0.24.6
func (op *DefinePatternProvides) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefinePatternProvides) TypeInfo ¶ added in v0.24.6
func (*DefinePatternProvides) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefinePatternProvides_Slice ¶ added in v0.24.6
type DefinePatternProvides_Slice []DefinePatternProvides
Holds a slice of type DefinePatternProvides.
func (*DefinePatternProvides_Slice) Repeats ¶ added in v0.24.6
func (op *DefinePatternProvides_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefinePatternProvides.
func (*DefinePatternProvides_Slice) TypeInfo ¶ added in v0.24.6
func (*DefinePatternProvides_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefinePatternProvides.
type DefinePattern_Slice ¶
type DefinePattern_Slice []DefinePattern
Holds a slice of type DefinePattern.
func (*DefinePattern_Slice) Repeats ¶
func (op *DefinePattern_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefinePattern.
func (*DefinePattern_Slice) TypeInfo ¶
func (*DefinePattern_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefinePattern.
type DefinePlural ¶
Controls how Tapestry pluralize words. Plurals are used both at runtime and during weave to guide the interpretation of nouns and kinds. A singular word can have multiple plurals; a plural word only has one singular form. For example: "The plural of person is people." "The plural of person is persons."
func (*DefinePlural) GetMarkup ¶
func (op *DefinePlural) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefinePlural) TypeInfo ¶
func (*DefinePlural) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefinePlural_Slice ¶
type DefinePlural_Slice []DefinePlural
Holds a slice of type DefinePlural.
func (*DefinePlural_Slice) Repeats ¶
func (op *DefinePlural_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefinePlural.
func (*DefinePlural_Slice) TypeInfo ¶
func (*DefinePlural_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefinePlural.
type DefineRelation ¶
type DefineRelation struct { RelationName rtti.TextEval KindName rtti.TextEval OtherKindName rtti.TextEval Cardinality RelationCardinality Markup map[string]any }
Defines a connection between different kinds of nouns. The shared library, for instance, defines a spatial relation between objects; allowing one object to be placed inside another.
func (*DefineRelation) GetMarkup ¶
func (op *DefineRelation) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineRelation) TypeInfo ¶
func (*DefineRelation) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineRelation_Slice ¶
type DefineRelation_Slice []DefineRelation
Holds a slice of type DefineRelation.
func (*DefineRelation_Slice) Repeats ¶
func (op *DefineRelation_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineRelation.
func (*DefineRelation_Slice) TypeInfo ¶
func (*DefineRelation_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineRelation.
type DefineRelatives ¶
type DefineRelatives struct { RelationName rtti.TextEval NounNames rtti.TextListEval OtherNounNames rtti.TextListEval Markup map[string]any }
Relate nouns to each other. Most users will probably prefer defining verbs and using jess to relate nouns. For instance: "Carrying is a verb. The relation of carrying is whereabouts. Bob is carrying the pen." See the Tapestry guide for details.
func (*DefineRelatives) GetMarkup ¶
func (op *DefineRelatives) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineRelatives) TypeInfo ¶
func (*DefineRelatives) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineRelatives_Slice ¶
type DefineRelatives_Slice []DefineRelatives
Holds a slice of type DefineRelatives.
func (*DefineRelatives_Slice) Repeats ¶
func (op *DefineRelatives_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineRelatives.
func (*DefineRelatives_Slice) TypeInfo ¶
func (*DefineRelatives_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineRelatives.
type DefineRule ¶ added in v0.24.6
type DefineRule struct { RuleTiming rtti.TextEval RuleName rtti.TextEval Exe []rtti.Execute Markup map[string]any }
Change the behavior of an existing pattern.
For patterns defined using DefinePattern, if a rule starts with a [core.ChooseBranch] command, and none of the branches are chosen, the pattern checks the next specified rule; and so on, until the pattern finds a branch that succeeds.
For patterns defined using DefineAction, rules behave as "event listeners". They continue to the next listener unless specifically stopped. And, by default, they only respond to actions triggered by the player.
See the Tapestry guide for more in-depth information.
func (*DefineRule) GetMarkup ¶ added in v0.24.6
func (op *DefineRule) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineRule) TypeInfo ¶ added in v0.24.6
func (*DefineRule) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineRule_Slice ¶ added in v0.24.6
type DefineRule_Slice []DefineRule
Holds a slice of type DefineRule.
func (*DefineRule_Slice) Repeats ¶ added in v0.24.6
func (op *DefineRule_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineRule.
func (*DefineRule_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineRule_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineRule.
type DefineScene ¶
type DefineScene struct { SceneName rtti.TextEval RequiredSceneNames rtti.TextListEval Statements []StoryStatement Markup map[string]any }
Defines a collection of nouns, kinds, game rules, etc. used the game. Every .tell story has its own unique scene.
func (*DefineScene) GetMarkup ¶
func (op *DefineScene) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineScene) GetSceneReqs ¶
errs if there's no scene name
func (*DefineScene) TypeInfo ¶
func (*DefineScene) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineScene_Slice ¶
type DefineScene_Slice []DefineScene
Holds a slice of type DefineScene.
func (*DefineScene_Slice) Repeats ¶
func (op *DefineScene_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineScene.
func (*DefineScene_Slice) TypeInfo ¶
func (*DefineScene_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineScene.
type DefineState ¶ added in v0.24.6
type DefineState struct { AspectName rtti.TextEval StateNames rtti.TextListEval Markup map[string]any }
Defines a set of mutually exclusive states that can be assigned to any kind of noun. By default, every noun with this set of states starts the game with the first state listed by this command. At runtime, a script can change to other states, ask whether a noun is in a particular state, or ask for the name of the current state from the set. Internally, these are also known as "aspects" and "traits." Many programming languages refer to these as "enumerations." See also: {"Set:state:"} and {"Object:field:"}
func (*DefineState) GetMarkup ¶ added in v0.24.6
func (op *DefineState) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DefineState) TypeInfo ¶ added in v0.24.6
func (*DefineState) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DefineState_Slice ¶ added in v0.24.6
type DefineState_Slice []DefineState
Holds a slice of type DefineState.
func (*DefineState_Slice) Repeats ¶ added in v0.24.6
func (op *DefineState_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineState.
func (*DefineState_Slice) TypeInfo ¶ added in v0.24.6
func (*DefineState_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineState.
type DefineTest ¶
type DefineTest struct { TestName string RequiredSceneNames rtti.TextListEval Statements []StoryStatement Exe []rtti.Execute Markup map[string]any }
Defines a scene used for testing a story. Tests can be executed using the `tap check` command. TODO: see https://todo.sr.ht/~ionous/tapestry/42
func (*DefineTest) GetMarkup ¶
func (op *DefineTest) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
type DefineTest_Slice ¶
type DefineTest_Slice []DefineTest
Holds a slice of type DefineTest.
func (*DefineTest_Slice) Repeats ¶
func (op *DefineTest_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DefineTest.
func (*DefineTest_Slice) TypeInfo ¶
func (*DefineTest_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DefineTest.
type FieldDefinition ¶
type FieldDefinition_Slot ¶
type FieldDefinition_Slot struct{ Value FieldDefinition }
Holds a single slot.
func (*FieldDefinition_Slot) TypeInfo ¶
func (*FieldDefinition_Slot) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a single slot.
type FieldDefinition_Slots ¶
type FieldDefinition_Slots []FieldDefinition
Holds a slice of slots.
func (*FieldDefinition_Slots) Repeats ¶
func (op *FieldDefinition_Slots) Repeats() bool
Implements typeinfo.Repeats for a slice of slots.
func (*FieldDefinition_Slots) TypeInfo ¶
func (*FieldDefinition_Slots) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of slots.
type NothingField ¶
A valueless field. Intended mainly as a way for patterns which don't return a value.
func (*NothingField) GetFieldInfo ¶
func (op *NothingField) GetFieldInfo(run rt.Runtime) (_ mdl.FieldInfo)
func (*NothingField) GetMarkup ¶
func (op *NothingField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*NothingField) TypeInfo ¶
func (*NothingField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type NothingField_Slice ¶
type NothingField_Slice []NothingField
Holds a slice of type NothingField.
func (*NothingField_Slice) Repeats ¶
func (op *NothingField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NothingField.
func (*NothingField_Slice) TypeInfo ¶
func (*NothingField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NothingField.
type NumField ¶ added in v0.24.6
A field containing a single number.
func (*NumField) GetFieldInfo ¶ added in v0.24.6
func (*NumField) GetMarkup ¶ added in v0.24.6
Implements typeinfo.Markup
type NumField_Slice ¶ added in v0.24.6
type NumField_Slice []NumField
Holds a slice of type NumField.
func (*NumField_Slice) Repeats ¶ added in v0.24.6
func (op *NumField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NumField.
func (*NumField_Slice) TypeInfo ¶ added in v0.24.6
func (*NumField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NumField.
type NumListField ¶
type NumListField struct { FieldName rtti.TextEval Initially rtti.NumListEval Markup map[string]any }
A field containing a list of numbers.
func (*NumListField) GetFieldInfo ¶
func (op *NumListField) GetFieldInfo(run rt.Runtime) mdl.FieldInfo
func (*NumListField) GetMarkup ¶
func (op *NumListField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*NumListField) TypeInfo ¶
func (*NumListField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type NumListField_Slice ¶
type NumListField_Slice []NumListField
Holds a slice of type NumListField.
func (*NumListField_Slice) Repeats ¶
func (op *NumListField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of NumListField.
func (*NumListField_Slice) TypeInfo ¶
func (*NumListField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of NumListField.
type PostImport ¶
type PreImport ¶
PreImport happens at the opening of a json block and it can transform the value into something completely new.
type RecordField ¶
type RecordField struct { FieldName rtti.TextEval RecordName rtti.TextEval Initially rtti.RecordEval Markup map[string]any }
A field containing a single record.
func (*RecordField) GetFieldInfo ¶
func (op *RecordField) GetFieldInfo(run rt.Runtime) mdl.FieldInfo
func (*RecordField) GetMarkup ¶
func (op *RecordField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*RecordField) TypeInfo ¶
func (*RecordField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type RecordField_Slice ¶
type RecordField_Slice []RecordField
Holds a slice of type RecordField.
func (*RecordField_Slice) Repeats ¶
func (op *RecordField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RecordField.
func (*RecordField_Slice) TypeInfo ¶
func (*RecordField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RecordField.
type RecordListField ¶
type RecordListField struct { FieldName rtti.TextEval RecordName rtti.TextEval Initially rtti.RecordListEval Markup map[string]any }
A field containing a list of records. All of the records in the list must be of the same type.
func (*RecordListField) GetFieldInfo ¶
func (op *RecordListField) GetFieldInfo(run rt.Runtime) mdl.FieldInfo
func (*RecordListField) GetMarkup ¶
func (op *RecordListField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*RecordListField) TypeInfo ¶
func (*RecordListField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type RecordListField_Slice ¶
type RecordListField_Slice []RecordListField
Holds a slice of type RecordListField.
func (*RecordListField_Slice) Repeats ¶
func (op *RecordListField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RecordListField.
func (*RecordListField_Slice) TypeInfo ¶
func (*RecordListField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RecordListField.
type RelationCardinality ¶
type RelationCardinality int
Used as part of DefineRelation to declare a new kind of relationship between nouns.
const ( C_RelationCardinality_OneToOne RelationCardinality = iota C_RelationCardinality_OneToMany C_RelationCardinality_ManyToOne C_RelationCardinality_ManyToMany )
The enumerated values of RelationCardinality.
func MakeRelationCardinality ¶
func MakeRelationCardinality(str string) (ret RelationCardinality, okay bool)
func (RelationCardinality) String ¶
func (op RelationCardinality) String() (ret string)
type SayResponse ¶
Print text in a replaceable manner. Each response has a unique name and a default bit of text it responds with. The response can be changed everywhere its used by replacing that text. ( ex. by using {"Define kind:fields": "response", "name of the response"} )
The shared library uses responses for much of what it prints to the player so that stories can change the stock phrases.
func (*SayResponse) GetMarkup ¶
func (op *SayResponse) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*SayResponse) PostImport ¶
transform SayResponse into a RenderResponse ( post import so it happens after any transforms in its evals have been processed )
func (*SayResponse) TypeInfo ¶
func (*SayResponse) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type SayResponse_Slice ¶
type SayResponse_Slice []SayResponse
Holds a slice of type SayResponse.
func (*SayResponse_Slice) Repeats ¶
func (op *SayResponse_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SayResponse.
func (*SayResponse_Slice) TypeInfo ¶
func (*SayResponse_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SayResponse.
type SayTemplate ¶
Print templated text. Templates contain commands executed at runtime. See the Tapestry guide for more information.
func (*SayTemplate) GetMarkup ¶
func (op *SayTemplate) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*SayTemplate) TypeInfo ¶
func (*SayTemplate) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type SayTemplate_Slice ¶
type SayTemplate_Slice []SayTemplate
Holds a slice of type SayTemplate.
func (*SayTemplate_Slice) Repeats ¶
func (op *SayTemplate_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SayTemplate.
func (*SayTemplate_Slice) TypeInfo ¶
func (*SayTemplate_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SayTemplate.
type StoryFile ¶
type StoryFile struct { Statements []StoryStatement Markup map[string]any }
Used internally as the container for every .tell file.
func (*StoryFile) GetMarkup ¶
Implements typeinfo.Markup
type StoryFile_Slice ¶
type StoryFile_Slice []StoryFile
Holds a slice of type StoryFile.
func (*StoryFile_Slice) Repeats ¶
func (op *StoryFile_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of StoryFile.
func (*StoryFile_Slice) TypeInfo ¶
func (*StoryFile_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of StoryFile.
type StoryNote ¶ added in v0.24.6
Used for the blockly editor so that hash-mark style comments are visible in the editor. Not needed when using .tell files.
func (*StoryNote) GetMarkup ¶ added in v0.24.6
Implements typeinfo.Markup
func (*StoryNote) TypeInfo ¶ added in v0.24.6
Implements typeinfo.Instance
type StoryNote_Slice ¶ added in v0.24.6
type StoryNote_Slice []StoryNote
Holds a slice of type StoryNote.
func (*StoryNote_Slice) Repeats ¶ added in v0.24.6
func (op *StoryNote_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of StoryNote.
func (*StoryNote_Slice) TypeInfo ¶ added in v0.24.6
func (*StoryNote_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of StoryNote.
type StoryStatement ¶
StoryStatement - a marker interface for commands which produce facts about the game world.
type StoryStatement_Slot ¶
type StoryStatement_Slot struct{ Value StoryStatement }
Holds a single slot.
func (*StoryStatement_Slot) TypeInfo ¶
func (*StoryStatement_Slot) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a single slot.
type StoryStatement_Slots ¶
type StoryStatement_Slots []StoryStatement
Holds a slice of slots.
func (*StoryStatement_Slots) Repeats ¶
func (op *StoryStatement_Slots) Repeats() bool
Implements typeinfo.Repeats for a slice of slots.
func (*StoryStatement_Slots) TypeInfo ¶
func (*StoryStatement_Slots) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of slots.
type TextField ¶
type TextField struct { FieldName rtti.TextEval KindName rtti.TextEval Initially rtti.TextEval Markup map[string]any }
A field containing a single piece of text. Text fields can be used to store anything from the name of a noun, the name of a state or set of states, or something to display to the player.
func (*TextField) GetMarkup ¶
Implements typeinfo.Markup
type TextField_Slice ¶
type TextField_Slice []TextField
Holds a slice of type TextField.
func (*TextField_Slice) Repeats ¶
func (op *TextField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of TextField.
func (*TextField_Slice) TypeInfo ¶
func (*TextField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of TextField.
type TextListField ¶
type TextListField struct { FieldName rtti.TextEval KindName rtti.TextEval Initially rtti.TextListEval Markup map[string]any }
A field containing a list of text.
func (*TextListField) GetFieldInfo ¶
func (op *TextListField) GetFieldInfo(run rt.Runtime) mdl.FieldInfo
func (*TextListField) GetMarkup ¶
func (op *TextListField) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*TextListField) TypeInfo ¶
func (*TextListField) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type TextListField_Slice ¶
type TextListField_Slice []TextListField
Holds a slice of type TextListField.
func (*TextListField_Slice) Repeats ¶
func (op *TextListField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of TextListField.
func (*TextListField_Slice) TypeInfo ¶
func (*TextListField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of TextListField.