Documentation ¶
Index ¶
- Variables
- type Header
- type Instruction
- func (*Instruction) Descriptor() ([]byte, []int)deprecated
- func (x *Instruction) GetOpcode() Instruction_OpCode
- func (x *Instruction) GetOperands() []*Operand
- func (*Instruction) ProtoMessage()
- func (x *Instruction) ProtoReflect() protoreflect.Message
- func (x *Instruction) Reset()
- func (x *Instruction) String() string
- type Instruction_OpCode
- func (Instruction_OpCode) Descriptor() protoreflect.EnumDescriptor
- func (x Instruction_OpCode) Enum() *Instruction_OpCode
- func (Instruction_OpCode) EnumDescriptor() ([]byte, []int)deprecated
- func (x Instruction_OpCode) Number() protoreflect.EnumNumber
- func (x Instruction_OpCode) String() string
- func (Instruction_OpCode) Type() protoreflect.EnumType
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetHeaders() []*Header
- func (x *Node) GetInstructions() []*Instruction
- func (x *Node) GetLabels() map[string]int32
- func (x *Node) GetName() string
- func (x *Node) GetSourceTextStringID() string
- func (x *Node) GetTags() []string
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- type Operand
- func (*Operand) Descriptor() ([]byte, []int)deprecated
- func (x *Operand) GetBoolValue() bool
- func (x *Operand) GetFloatValue() float32
- func (x *Operand) GetStringValue() string
- func (m *Operand) GetValue() isOperand_Value
- func (*Operand) ProtoMessage()
- func (x *Operand) ProtoReflect() protoreflect.Message
- func (x *Operand) Reset()
- func (x *Operand) String() string
- type Operand_BoolValue
- type Operand_FloatValue
- type Operand_StringValue
- type Program
- func (*Program) Descriptor() ([]byte, []int)deprecated
- func (x *Program) GetInitialValues() map[string]*Operand
- func (x *Program) GetName() string
- func (x *Program) GetNodes() map[string]*Node
- func (*Program) ProtoMessage()
- func (x *Program) ProtoReflect() protoreflect.Message
- func (x *Program) Reset()
- func (x *Program) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Instruction_OpCode_name = map[int32]string{ 0: "JUMP_TO", 1: "JUMP", 2: "RUN_LINE", 3: "RUN_COMMAND", 4: "ADD_OPTION", 5: "SHOW_OPTIONS", 6: "PUSH_STRING", 7: "PUSH_FLOAT", 8: "PUSH_BOOL", 9: "PUSH_NULL", 10: "JUMP_IF_FALSE", 11: "POP", 12: "CALL_FUNC", 13: "PUSH_VARIABLE", 14: "STORE_VARIABLE", 15: "STOP", 16: "RUN_NODE", } Instruction_OpCode_value = map[string]int32{ "JUMP_TO": 0, "JUMP": 1, "RUN_LINE": 2, "RUN_COMMAND": 3, "ADD_OPTION": 4, "SHOW_OPTIONS": 5, "PUSH_STRING": 6, "PUSH_FLOAT": 7, "PUSH_BOOL": 8, "PUSH_NULL": 9, "JUMP_IF_FALSE": 10, "POP": 11, "CALL_FUNC": 12, "PUSH_VARIABLE": 13, "STORE_VARIABLE": 14, "STOP": 15, "RUN_NODE": 16, } )
Enum value maps for Instruction_OpCode.
View Source
var File_yarn_spinner_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Header) Descriptor
deprecated
func (*Header) ProtoMessage ¶
func (*Header) ProtoMessage()
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type Instruction ¶
type Instruction struct { // The operation that this instruction will perform. Opcode Instruction_OpCode `protobuf:"varint,1,opt,name=opcode,proto3,enum=Yarn.Instruction_OpCode" json:"opcode,omitempty"` // The list of operands, if any, that this instruction uses. Operands []*Operand `protobuf:"bytes,2,rep,name=operands,proto3" json:"operands,omitempty"` // contains filtered or unexported fields }
A single Yarn instruction.
func (*Instruction) Descriptor
deprecated
func (*Instruction) Descriptor() ([]byte, []int)
Deprecated: Use Instruction.ProtoReflect.Descriptor instead.
func (*Instruction) GetOpcode ¶
func (x *Instruction) GetOpcode() Instruction_OpCode
func (*Instruction) GetOperands ¶
func (x *Instruction) GetOperands() []*Operand
func (*Instruction) ProtoMessage ¶
func (*Instruction) ProtoMessage()
func (*Instruction) ProtoReflect ¶
func (x *Instruction) ProtoReflect() protoreflect.Message
func (*Instruction) Reset ¶
func (x *Instruction) Reset()
func (*Instruction) String ¶
func (x *Instruction) String() string
type Instruction_OpCode ¶
type Instruction_OpCode int32
The type of instruction that this is.
const ( // Jumps to a named position in the node. // opA = string: label name Instruction_JUMP_TO Instruction_OpCode = 0 // Peeks a string from stack, and jumps to that named position in // the node. // No operands. Instruction_JUMP Instruction_OpCode = 1 // Delivers a string ID to the client. // opA = string: string ID Instruction_RUN_LINE Instruction_OpCode = 2 // Delivers a command to the client. // opA = string: command text Instruction_RUN_COMMAND Instruction_OpCode = 3 // Adds an entry to the option list (see ShowOptions). // - opA = string: string ID for option to add // - opB = string: destination to go to if this option is selected // - opC = number: number of expressions on the stack to insert // into the line // - opD = bool: whether the option has a condition on it (in which // case a value should be popped off the stack and used to signal // the game that the option should be not available) Instruction_ADD_OPTION Instruction_OpCode = 4 // Presents the current list of options to the client, then clears // the list. The most recently selected option will be on the top // of the stack when execution resumes. // No operands. Instruction_SHOW_OPTIONS Instruction_OpCode = 5 // Pushes a string onto the stack. // opA = string: the string to push to the stack. Instruction_PUSH_STRING Instruction_OpCode = 6 // Pushes a floating point number onto the stack. // opA = float: number to push to stack Instruction_PUSH_FLOAT Instruction_OpCode = 7 // Pushes a boolean onto the stack. // opA = bool: the bool to push to stack Instruction_PUSH_BOOL Instruction_OpCode = 8 // Pushes a null value onto the stack. // No operands. Instruction_PUSH_NULL Instruction_OpCode = 9 // Jumps to the named position in the the node, if the top of the // stack is not null, zero or false. // opA = string: label name Instruction_JUMP_IF_FALSE Instruction_OpCode = 10 // Discards top of stack. // No operands. Instruction_POP Instruction_OpCode = 11 // Calls a function in the client. Pops as many arguments as the // client indicates the function receives, and the result (if any) // is pushed to the stack. // opA = string: name of the function Instruction_CALL_FUNC Instruction_OpCode = 12 // Pushes the contents of a variable onto the stack. // opA = name of variable Instruction_PUSH_VARIABLE Instruction_OpCode = 13 // Stores the contents of the top of the stack in the named // variable. // opA = name of variable Instruction_STORE_VARIABLE Instruction_OpCode = 14 // Stops execution of the program. // No operands. Instruction_STOP Instruction_OpCode = 15 // Pops a string off the top of the stack, and runs the node with // that name. // No operands. Instruction_RUN_NODE Instruction_OpCode = 16 )
func (Instruction_OpCode) Descriptor ¶
func (Instruction_OpCode) Descriptor() protoreflect.EnumDescriptor
func (Instruction_OpCode) Enum ¶
func (x Instruction_OpCode) Enum() *Instruction_OpCode
func (Instruction_OpCode) EnumDescriptor
deprecated
func (Instruction_OpCode) EnumDescriptor() ([]byte, []int)
Deprecated: Use Instruction_OpCode.Descriptor instead.
func (Instruction_OpCode) Number ¶
func (x Instruction_OpCode) Number() protoreflect.EnumNumber
func (Instruction_OpCode) String ¶
func (x Instruction_OpCode) String() string
func (Instruction_OpCode) Type ¶
func (Instruction_OpCode) Type() protoreflect.EnumType
type Node ¶
type Node struct { // The name of this node. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The list of instructions in this node. Instructions []*Instruction `protobuf:"bytes,2,rep,name=instructions,proto3" json:"instructions,omitempty"` // A jump table, mapping the names of labels to positions in the // instructions list. Labels map[string]int32 `` /* 154-byte string literal not displayed */ // The tags associated with this node. Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"` // the entry in the program's string table that contains the original // text of this node; null if this is not available SourceTextStringID string `protobuf:"bytes,5,opt,name=sourceTextStringID,proto3" json:"sourceTextStringID,omitempty"` Headers []*Header `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"` // contains filtered or unexported fields }
A collection of instructions
func (*Node) Descriptor
deprecated
func (*Node) GetHeaders ¶
func (*Node) GetInstructions ¶
func (x *Node) GetInstructions() []*Instruction
func (*Node) GetSourceTextStringID ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type Operand ¶
type Operand struct { // The type of operand this is. // // Types that are assignable to Value: // // *Operand_StringValue // *Operand_BoolValue // *Operand_FloatValue Value isOperand_Value `protobuf_oneof:"value"` // contains filtered or unexported fields }
A value used by an Instruction.
func (*Operand) Descriptor
deprecated
func (*Operand) GetBoolValue ¶
func (*Operand) GetFloatValue ¶
func (*Operand) GetStringValue ¶
func (*Operand) ProtoMessage ¶
func (*Operand) ProtoMessage()
func (*Operand) ProtoReflect ¶
func (x *Operand) ProtoReflect() protoreflect.Message
type Operand_BoolValue ¶
type Operand_BoolValue struct { // A boolean (true or false). BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` }
type Operand_FloatValue ¶
type Operand_FloatValue struct { // A floating point number. FloatValue float32 `protobuf:"fixed32,3,opt,name=float_value,json=floatValue,proto3,oneof"` }
type Operand_StringValue ¶
type Operand_StringValue struct { // A string. StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"` }
type Program ¶
type Program struct { // The name of the program. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The collection of nodes in this program. Nodes map[string]*Node `` /* 151-byte string literal not displayed */ // The collection of initial values for variables; if a PUSH_VARIABLE // instruction is run, and the value is not found in the storage, this // value will be used InitialValues map[string]*Operand `` /* 188-byte string literal not displayed */ // contains filtered or unexported fields }
A complete Yarn program.
func (*Program) Descriptor
deprecated
func (*Program) GetInitialValues ¶
func (*Program) ProtoMessage ¶
func (*Program) ProtoMessage()
func (*Program) ProtoReflect ¶
func (x *Program) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.