entity

package
v0.0.0-...-371d674 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	P_SYS_ID        = "$uuid"
	P_SYS_PATH      = "$path"
	P_SYS_EXCLUSIVE = "$exclusive"
	P_SYS_ACTIVE    = "$active"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

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

Entity represents any in-game object that exists

func NewEntity

func NewEntity() *Entity

func (*Entity) Call

func (e *Entity) Call(funName string, args ...interface{}) (otto.Value, error)

func (Entity) Context

func (e Entity) Context() script_context_api

func (*Entity) Create

func (e *Entity) Create(script script_context_api) error

func (Entity) GetProp

func (e Entity) GetProp(name string) interface{}

GetProp returns you the value of a previously set property or nil (undefined) if the property is not set.

func (Entity) GetScriptPrivilegeLevel

func (e Entity) GetScriptPrivilegeLevel() privilege.Level

func (*Entity) GetScriptReferenceEntity

func (e *Entity) GetScriptReferenceEntity() *Entity

func (Entity) HasFunction

func (e Entity) HasFunction(funName string) bool

HasFunction returns true if a function of the given name is defined or will return false otherwise. This can be used to check if an entity has a function that you wish to call

func (*Entity) Heartbeat

func (e *Entity) Heartbeat() error

Heartbeat will take care that the $tick function is called whenever a heartbeat of the driver occurs

func (Entity) IsActive

func (e Entity) IsActive() bool

IsActive indicates if the entity is still active or not. Inactive entities are considered to be already destroyed or not-yet set up correctly and must not be accessed in any way.

func (*Entity) OnShutdown

func (e *Entity) OnShutdown(reason string)

func (*Entity) SetProp

func (e *Entity) SetProp(name string, value interface{})

SetProp assigns a value to an entity property.

type FunctionInvocationError

type FunctionInvocationError struct {
	Err    error
	Entity *Entity
}

func (FunctionInvocationError) Error

func (f FunctionInvocationError) Error() string

Jump to

Keyboard shortcuts

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