Documentation ¶
Overview ¶
Operations on objects, variables, and kinds.
Index ¶
- Variables
- func GetNamedValue(run rt.Runtime, name string, dots []Dot) (ret rt.Value, err error)
- func Register(reg func(any))
- type AtField
- type AtField_Slice
- type AtIndex
- type AtIndex_Slice
- type DecrementAspect
- type DecrementAspect_Slice
- type Dot
- type Dot_Slot
- type Dot_Slots
- type FieldsOfKind
- type FieldsOfKind_Slice
- type IncrementAspect
- type IncrementAspect_Slice
- type IsExactKindOf
- type IsExactKindOf_Slice
- type IsKindOf
- type IsKindOf_Slice
- type KindOf
- type KindOf_Slice
- type KindsOf
- type KindsOf_Slice
- type ObjectDot
- func (op *ObjectDot) GetBool(run rt.Runtime) (ret rt.Value, err error)
- func (op *ObjectDot) GetMarkup(ensure bool) map[string]any
- func (op *ObjectDot) GetNum(run rt.Runtime) (rt.Value, error)
- func (op *ObjectDot) GetNumList(run rt.Runtime) (rt.Value, error)
- func (op *ObjectDot) GetRecord(run rt.Runtime) (rt.Value, error)
- func (op *ObjectDot) GetRecordList(run rt.Runtime) (rt.Value, error)
- func (op *ObjectDot) GetReference(run rt.Runtime) (ret rt.Reference, err error)
- func (op *ObjectDot) GetText(run rt.Runtime) (ret rt.Value, err error)
- func (op *ObjectDot) GetTextList(run rt.Runtime) (rt.Value, error)
- func (*ObjectDot) TypeInfo() typeinfo.T
- type ObjectDot_Slice
- type ObjectName
- type ObjectName_Slice
- type ObjectStates
- type ObjectStates_Slice
- type RecordDot
- func (op *RecordDot) GetBool(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetMarkup(ensure bool) map[string]any
- func (op *RecordDot) GetNum(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetNumList(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetRecord(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetRecordList(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetReference(run rt.Runtime) (ret rt.Reference, err error)
- func (op *RecordDot) GetText(run rt.Runtime) (rt.Value, error)
- func (op *RecordDot) GetTextList(run rt.Runtime) (rt.Value, error)
- func (*RecordDot) TypeInfo() typeinfo.T
- type RecordDot_Slice
- type SetState
- type SetState_Slice
- type SetValue
- type SetValue_Slice
- type VariableDot
- func (op *VariableDot) GetBool(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetMarkup(ensure bool) map[string]any
- func (op *VariableDot) GetNum(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetNumList(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetRecord(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetRecordList(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetReference(run rt.Runtime) (ret rt.Reference, err error)
- func (op *VariableDot) GetText(run rt.Runtime) (rt.Value, error)
- func (op *VariableDot) GetTextList(run rt.Runtime) (rt.Value, error)
- func (*VariableDot) TypeInfo() typeinfo.T
- type VariableDot_Slice
Constants ¶
This section is empty.
Variables ¶
var Z_Types = typeinfo.TypeSet{ Name: "object", Comment: []string{ "Operations on objects, variables, and kinds.", }, Slot: z_slot_list, Flow: z_flow_list, Signatures: z_signatures, }
package listing of type data
var Zt_AtField typeinfo.Flow
at_field, a type of flow.
var Zt_AtIndex typeinfo.Flow
at_index, a type of flow.
var Zt_DecrementAspect typeinfo.Flow
decrement_aspect, a type of flow.
var Zt_Dot = typeinfo.Slot{ Name: "dot", Markup: map[string]any{ "--": "Access values stored inside other values.", }, }
dot, a type of slot.
var Zt_FieldsOfKind typeinfo.Flow
fields_of_kind, a type of flow.
var Zt_IncrementAspect typeinfo.Flow
increment_aspect, a type of flow.
var Zt_IsExactKindOf typeinfo.Flow
is_exact_kind_of, a type of flow.
var Zt_IsKindOf typeinfo.Flow
is_kind_of, a type of flow.
var Zt_KindOf typeinfo.Flow
kind_of, a type of flow.
var Zt_KindsOf typeinfo.Flow
kinds_of, a type of flow.
var Zt_ObjectDot typeinfo.Flow
object_dot, a type of flow.
var Zt_ObjectName typeinfo.Flow
object_name, a type of flow.
var Zt_ObjectStates typeinfo.Flow
object_states, a type of flow.
var Zt_RecordDot typeinfo.Flow
record_dot, a type of flow.
var Zt_SetState typeinfo.Flow
set_state, a type of flow.
var Zt_SetValue typeinfo.Flow
set_value, a type of flow.
var Zt_VariableDot typeinfo.Flow
variable_dot, a type of flow.
Functions ¶
func GetNamedValue ¶
note: currently templates can't analyze the context they're being called in, so: if the command is being used to get an object value and no variable can be found in the current context of the requested name, see if the requested name is an object instead.
Types ¶
type AtField ¶
Select a named field from a record, or a named property from an object.
func (*AtField) GetMarkup ¶
Implements typeinfo.Markup
type AtField_Slice ¶
type AtField_Slice []AtField
Holds a slice of type AtField.
func (*AtField_Slice) Repeats ¶
func (op *AtField_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of AtField.
func (*AtField_Slice) TypeInfo ¶
func (*AtField_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of AtField.
type AtIndex ¶
Select a value from a list of values.
func (*AtIndex) GetMarkup ¶
Implements typeinfo.Markup
type AtIndex_Slice ¶
type AtIndex_Slice []AtIndex
Holds a slice of type AtIndex.
func (*AtIndex_Slice) Repeats ¶
func (op *AtIndex_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of AtIndex.
func (*AtIndex_Slice) TypeInfo ¶
func (*AtIndex_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of AtIndex.
type DecrementAspect ¶
type DecrementAspect struct { Target rtti.Address AspectName rtti.TextEval Step rtti.NumEval Clamp rtti.BoolEval Markup map[string]any `json:",omitempty"` }
Change to the previous state in some particular set of states for a given object ( or record. ) Optionally, returns the new value of the state. Uses the order of the states where as they were originally defined. See [DefineState].
func (*DecrementAspect) GetMarkup ¶
func (op *DecrementAspect) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*DecrementAspect) TypeInfo ¶
func (*DecrementAspect) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type DecrementAspect_Slice ¶
type DecrementAspect_Slice []DecrementAspect
Holds a slice of type DecrementAspect.
func (*DecrementAspect_Slice) Repeats ¶
func (op *DecrementAspect_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of DecrementAspect.
func (*DecrementAspect_Slice) TypeInfo ¶
func (*DecrementAspect_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of DecrementAspect.
type Dot_Slots ¶
type Dot_Slots []Dot
Holds a slice of slots.
func (*Dot_Slots) Repeats ¶
Implements typeinfo.Repeats for a slice of slots.
type FieldsOfKind ¶
A list of the fields of a given kind.
func (*FieldsOfKind) GetMarkup ¶
func (op *FieldsOfKind) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*FieldsOfKind) GetTextList ¶
tbd: fields of kind could be expanded to full introspection if the Field structure was a record. ( maybe some core classes could be exposed using the test reflection? might make porting harder )
func (*FieldsOfKind) TypeInfo ¶
func (*FieldsOfKind) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type FieldsOfKind_Slice ¶
type FieldsOfKind_Slice []FieldsOfKind
Holds a slice of type FieldsOfKind.
func (*FieldsOfKind_Slice) Repeats ¶
func (op *FieldsOfKind_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of FieldsOfKind.
func (*FieldsOfKind_Slice) TypeInfo ¶
func (*FieldsOfKind_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of FieldsOfKind.
type IncrementAspect ¶
type IncrementAspect struct { Target rtti.Address AspectName rtti.TextEval Step rtti.NumEval Clamp rtti.BoolEval Markup map[string]any `json:",omitempty"` }
Change to the next state in some particular set of states for a given object ( or record. ) Optionally, returns the new value of the state. Uses the order of the states where as they were originally defined. See [DefineState].
func (*IncrementAspect) GetMarkup ¶
func (op *IncrementAspect) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*IncrementAspect) TypeInfo ¶
func (*IncrementAspect) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type IncrementAspect_Slice ¶
type IncrementAspect_Slice []IncrementAspect
Holds a slice of type IncrementAspect.
func (*IncrementAspect_Slice) Repeats ¶
func (op *IncrementAspect_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IncrementAspect.
func (*IncrementAspect_Slice) TypeInfo ¶
func (*IncrementAspect_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IncrementAspect.
type IsExactKindOf ¶
type IsExactKindOf struct { Target rtti.Address KindName rtti.TextEval Markup map[string]any `json:",omitempty"` }
Determine whether an object (or record) is of exactly the named kind. For example, all containers are a kind of prop. Asking if a container is exactly a prop would return false. See also IsKindOf.
func (*IsExactKindOf) GetBool ¶
returns true if the indicated object is of the specified kind but not a kind that derives from the specified kind. returns an error if there is no such object; returns the false for an empty request.
func (*IsExactKindOf) GetMarkup ¶
func (op *IsExactKindOf) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*IsExactKindOf) TypeInfo ¶
func (*IsExactKindOf) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type IsExactKindOf_Slice ¶
type IsExactKindOf_Slice []IsExactKindOf
Holds a slice of type IsExactKindOf.
func (*IsExactKindOf_Slice) Repeats ¶
func (op *IsExactKindOf_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsExactKindOf.
func (*IsExactKindOf_Slice) TypeInfo ¶
func (*IsExactKindOf_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsExactKindOf.
type IsKindOf ¶
type IsKindOf struct { Target rtti.Address KindName rtti.TextEval Nothing bool Markup map[string]any `json:",omitempty"` }
Determine whether an object (or record) is compatible with the named kind. For example, all containers are a kind of prop. Asking if a container is a kind of a prop would return true. See also IsExactKindOf.
func (*IsKindOf) GetBool ¶
returns true if the indicated object is of the specified kind. returns an error if there is no such object; returns the false for an empty request UNLESS nothing objects were specified as being allowed to match.
func (*IsKindOf) GetMarkup ¶
Implements typeinfo.Markup
type IsKindOf_Slice ¶
type IsKindOf_Slice []IsKindOf
Holds a slice of type IsKindOf.
func (*IsKindOf_Slice) Repeats ¶
func (op *IsKindOf_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of IsKindOf.
func (*IsKindOf_Slice) TypeInfo ¶
func (*IsKindOf_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of IsKindOf.
type KindOf ¶
The kind of an object or record.
func (*KindOf) GetMarkup ¶
Implements typeinfo.Markup
type KindOf_Slice ¶
type KindOf_Slice []KindOf
Holds a slice of type KindOf.
func (*KindOf_Slice) Repeats ¶
func (op *KindOf_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of KindOf.
func (*KindOf_Slice) TypeInfo ¶
func (*KindOf_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of KindOf.
type KindsOf ¶
type KindsOf struct { KindName rtti.TextEval BoolPatternName string Markup map[string]any `json:",omitempty"` }
A list of all objects accessible by the current scene and compatible with the specified kind.
func (*KindsOf) GetMarkup ¶
Implements typeinfo.Markup
func (*KindsOf) GetTextList ¶
returns a list of all objects of the specified kind.
type KindsOf_Slice ¶
type KindsOf_Slice []KindsOf
Holds a slice of type KindsOf.
func (*KindsOf_Slice) Repeats ¶
func (op *KindsOf_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of KindsOf.
func (*KindsOf_Slice) TypeInfo ¶
func (*KindsOf_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of KindsOf.
type ObjectDot ¶
type ObjectDot struct { NounName rtti.TextEval Dot []Dot Markup map[string]any `json:",omitempty"` }
Read a value from an object. As a special case, if there are no dot parts, this will return the id of the object. In .tell files, this command is often specified with a shortcut. For example:
"#my_object.some_field"
is a shorter way to say:
Object:dot: - "my object" - "some field"
WARNING: This doesn't convert values from one type to another. For instance, if a field was declared as text, this will error if read as a boolean.
func (*ObjectDot) GetMarkup ¶
Implements typeinfo.Markup
func (*ObjectDot) GetRecordList ¶
func (*ObjectDot) GetReference ¶
type ObjectDot_Slice ¶
type ObjectDot_Slice []ObjectDot
Holds a slice of type ObjectDot.
func (*ObjectDot_Slice) Repeats ¶
func (op *ObjectDot_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ObjectDot.
func (*ObjectDot_Slice) TypeInfo ¶
func (*ObjectDot_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ObjectDot.
type ObjectName ¶
The full name of an object as originally specified by the author. Generates an error for unknown objects except it returns empty text when given empty text. See also ObjectDot which can return the object's unique id.
func (*ObjectName) GetMarkup ¶
func (op *ObjectName) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
type ObjectName_Slice ¶
type ObjectName_Slice []ObjectName
Holds a slice of type ObjectName.
func (*ObjectName_Slice) Repeats ¶
func (op *ObjectName_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ObjectName.
func (*ObjectName_Slice) TypeInfo ¶
func (*ObjectName_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ObjectName.
type ObjectStates ¶
All of an object's current states as a list of text. ( Despite the name, can also be used on records. )
func (*ObjectStates) GetMarkup ¶
func (op *ObjectStates) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*ObjectStates) GetTextList ¶
func (*ObjectStates) TypeInfo ¶
func (*ObjectStates) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type ObjectStates_Slice ¶
type ObjectStates_Slice []ObjectStates
Holds a slice of type ObjectStates.
func (*ObjectStates_Slice) Repeats ¶
func (op *ObjectStates_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of ObjectStates.
func (*ObjectStates_Slice) TypeInfo ¶
func (*ObjectStates_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of ObjectStates.
type RecordDot ¶ added in v0.24.8
type RecordDot struct { Value rtti.RecordEval Dot []Dot Markup map[string]any `json:",omitempty"` }
Read a value from a record. WARNING: This doesn't convert values from one type to another.
func (*RecordDot) GetMarkup ¶ added in v0.24.8
Implements typeinfo.Markup
func (*RecordDot) GetNumList ¶ added in v0.24.8
func (*RecordDot) GetRecordList ¶ added in v0.24.8
func (*RecordDot) GetReference ¶ added in v0.24.8
func (*RecordDot) GetTextList ¶ added in v0.24.8
type RecordDot_Slice ¶ added in v0.24.8
type RecordDot_Slice []RecordDot
Holds a slice of type RecordDot.
func (*RecordDot_Slice) Repeats ¶ added in v0.24.8
func (op *RecordDot_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of RecordDot.
func (*RecordDot_Slice) TypeInfo ¶ added in v0.24.8
func (*RecordDot_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of RecordDot.
type SetState ¶
type SetState struct { Target rtti.Address StateName rtti.TextEval Markup map[string]any `json:",omitempty"` }
Set the state of an object or record. See also: story `Define state:names:`.
func (*SetState) GetMarkup ¶
Implements typeinfo.Markup
type SetState_Slice ¶
type SetState_Slice []SetState
Holds a slice of type SetState.
func (*SetState_Slice) Repeats ¶
func (op *SetState_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SetState.
func (*SetState_Slice) TypeInfo ¶
func (*SetState_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SetState.
type SetValue ¶
type SetValue struct { Target rtti.Address Value rtti.Assignment Markup map[string]any `json:",omitempty"` }
Store a value into a variable or object. Values are specified as a generic [Assignment]. The various "From" commands exist to cast specific value types into an assignment.
WARNING: This doesn't convert values from one type to another. For example:
Set:value: - "@some_local_variable" - FromText: "a piece of text to store."
will only work if the local variable can store text. If the variable was declared as a number, the command will generate an error.
func (*SetValue) GetMarkup ¶
Implements typeinfo.Markup
type SetValue_Slice ¶
type SetValue_Slice []SetValue
Holds a slice of type SetValue.
func (*SetValue_Slice) Repeats ¶
func (op *SetValue_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of SetValue.
func (*SetValue_Slice) TypeInfo ¶
func (*SetValue_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of SetValue.
type VariableDot ¶
type VariableDot struct { VariableName rtti.TextEval Dot []Dot Markup map[string]any `json:",omitempty"` }
Read a value from a variable. In .tell files, this command is often specified with a shortcut. For example:
"@some_local_variable"
is a shorter way to say:
Variable:dot: "some local variable"
WARNING: This doesn't convert values from one type to another. For instance, if a field was declared as text, this will error if read as a boolean.
func Variable ¶
func Variable(name string, path ...any) *VariableDot
generate a statement which extracts a variable's value. path can include strings ( for reading from records ) or integers ( for reading from lists )
func (*VariableDot) GetMarkup ¶
func (op *VariableDot) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
func (*VariableDot) GetNumList ¶
func (*VariableDot) GetRecordList ¶
func (*VariableDot) GetReference ¶
func (*VariableDot) GetTextList ¶
func (*VariableDot) TypeInfo ¶
func (*VariableDot) TypeInfo() typeinfo.T
Implements typeinfo.Instance
type VariableDot_Slice ¶
type VariableDot_Slice []VariableDot
Holds a slice of type VariableDot.
func (*VariableDot_Slice) Repeats ¶
func (op *VariableDot_Slice) Repeats() bool
Implements typeinfo.Repeats for a slice of VariableDot.
func (*VariableDot_Slice) TypeInfo ¶
func (*VariableDot_Slice) TypeInfo() typeinfo.T
Implements typeinfo.Instance for a slice of VariableDot.