bytecode

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

bytecode

The yarn_spinner.pb.go file was generated using protoc-gen-go on the Yarn Spinner 2.0 yarn_spinner.proto file. yarn_spinner.pb.go is therefore a derivative work of Yarn Spinner. The original copyright notice and license text is reproduced below.

--

The MIT License (MIT)

Copyright (c) 2015-2017 Secret Lab Pty. Ltd. and Yarn Spinner contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

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 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) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetKey

func (x *Header) GetKey() string

func (*Header) GetValue

func (x *Header) GetValue() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

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) Enum

func (Instruction_OpCode) EnumDescriptor deprecated

func (Instruction_OpCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use Instruction_OpCode.Descriptor instead.

func (Instruction_OpCode) Number

func (Instruction_OpCode) String

func (x Instruction_OpCode) String() string

func (Instruction_OpCode) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetHeaders

func (x *Node) GetHeaders() []*Header

func (*Node) GetInstructions

func (x *Node) GetInstructions() []*Instruction

func (*Node) GetLabels

func (x *Node) GetLabels() map[string]int32

func (*Node) GetName

func (x *Node) GetName() string

func (*Node) GetSourceTextStringID

func (x *Node) GetSourceTextStringID() string

func (*Node) GetTags

func (x *Node) GetTags() []string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Operand.ProtoReflect.Descriptor instead.

func (*Operand) GetBoolValue

func (x *Operand) GetBoolValue() bool

func (*Operand) GetFloatValue

func (x *Operand) GetFloatValue() float32

func (*Operand) GetStringValue

func (x *Operand) GetStringValue() string

func (*Operand) GetValue

func (m *Operand) GetValue() isOperand_Value

func (*Operand) ProtoMessage

func (*Operand) ProtoMessage()

func (*Operand) ProtoReflect

func (x *Operand) ProtoReflect() protoreflect.Message

func (*Operand) Reset

func (x *Operand) Reset()

func (*Operand) String

func (x *Operand) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Program.ProtoReflect.Descriptor instead.

func (*Program) GetInitialValues

func (x *Program) GetInitialValues() map[string]*Operand

func (*Program) GetName

func (x *Program) GetName() string

func (*Program) GetNodes

func (x *Program) GetNodes() map[string]*Node

func (*Program) ProtoMessage

func (*Program) ProtoMessage()

func (*Program) ProtoReflect

func (x *Program) ProtoReflect() protoreflect.Message

func (*Program) Reset

func (x *Program) Reset()

func (*Program) String

func (x *Program) String() string

Jump to

Keyboard shortcuts

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