noxscript

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CallerID  = ObjID(-1)
	TriggerID = ObjID(-2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builtin

type Builtin struct {
	Fnc           BuiltinFunc
	NeedsNamePref bool
	NeedsPosOff   bool
	ReadMore      bool
	ReadEvenMore  bool
}

type BuiltinFunc

type BuiltinFunc func(r *Runtime) (int, error)

type ErrNoFunc

type ErrNoFunc struct {
	Func string
}

func (*ErrNoFunc) Error

func (e *ErrNoFunc) Error() string

type Error

type Error struct {
	Func string
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Func

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

func (*Func) Call

func (f *Func) Call(caller, trigger Object, args ...interface{}) (gerr error)

func (*Func) CallBuiltin

func (f *Func) CallBuiltin(code int) (int, error)

func (*Func) Def

func (f *Func) Def() *asm.FuncDef

func (*Func) Name

func (f *Func) Name() string

type ObjID

type ObjID int

type Object

type Object interface {
	NoxScriptID() ObjID
	GetNoxScriptVal(ind int) int32
	SetNoxScriptVal(ind int, val int32)
}

type Runtime

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

func LoadScript

func LoadScript(rd io.Reader) (*Runtime, error)

func NewRuntime

func NewRuntime() *Runtime

func (*Runtime) AddString

func (r *Runtime) AddString(s string) int

func (*Runtime) BuiltinNamePref

func (r *Runtime) BuiltinNamePref() string

func (*Runtime) BuiltinPosOff

func (r *Runtime) BuiltinPosOff() image.Point

func (*Runtime) CallByName

func (r *Runtime) CallByName(name string, caller, trigger Object, args ...interface{}) error

func (*Runtime) CallByPrefix

func (r *Runtime) CallByPrefix(pref string, caller, trigger Object, args ...interface{}) error

func (*Runtime) CallFirst

func (r *Runtime) CallFirst(isSwitchToSolo bool) error

func (*Runtime) FuncByInd

func (r *Runtime) FuncByInd(i int) *Func

func (*Runtime) FuncByName

func (r *Runtime) FuncByName(name string) *Func

func (*Runtime) FuncByPref

func (r *Runtime) FuncByPref(pref string) []*Func

func (*Runtime) GetCaller

func (r *Runtime) GetCaller() Object

func (*Runtime) GetString

func (r *Runtime) GetString(i int) string

func (*Runtime) GetTrigger

func (r *Runtime) GetTrigger() Object

func (*Runtime) IndexByName

func (r *Runtime) IndexByName(name string) int

func (*Runtime) LoadScript

func (r *Runtime) LoadScript(sc *asm.Script) error

func (*Runtime) PanicsCompilerEnabled

func (r *Runtime) PanicsCompilerEnabled() bool

func (*Runtime) PopBool

func (r *Runtime) PopBool() bool

func (*Runtime) PopFloat32

func (r *Runtime) PopFloat32() float32

func (*Runtime) PopInt

func (r *Runtime) PopInt() int

func (*Runtime) PopInt32

func (r *Runtime) PopInt32() int32

func (*Runtime) PopObjectID

func (r *Runtime) PopObjectID() ObjID

func (*Runtime) PopString

func (r *Runtime) PopString() string

func (*Runtime) PopUint32

func (r *Runtime) PopUint32() uint32

func (*Runtime) PushBool

func (r *Runtime) PushBool(v bool)

func (*Runtime) PushFloat32

func (r *Runtime) PushFloat32(v float32)

func (*Runtime) PushInt

func (r *Runtime) PushInt(v int)

func (*Runtime) PushInt32

func (r *Runtime) PushInt32(v int32)

func (*Runtime) PushObject

func (r *Runtime) PushObject(v Object)

func (*Runtime) PushObjectID

func (r *Runtime) PushObjectID(v ObjID)

func (*Runtime) PushString

func (r *Runtime) PushString(s string)

func (*Runtime) PushUint32

func (r *Runtime) PushUint32(v uint32)

func (*Runtime) ReadScript

func (r *Runtime) ReadScript(rd io.Reader) error

func (*Runtime) RegisterBuiltin

func (r *Runtime) RegisterBuiltin(code int, b *Builtin)

func (*Runtime) Reset

func (r *Runtime) Reset()

func (*Runtime) StackAt

func (r *Runtime) StackAt(i int) uint32

Jump to

Keyboard shortcuts

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