entity

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddComp

func AddComp[T Comp](entityHandle registry.Handle, cc *CompContainer, c T)

func DestroyComp added in v0.14.0

func DestroyComp[T Comp](e *CompContainer)

DestroyComp calls Destroy on the component and then removes it from the entities component list

func GetComp

func GetComp[T Comp](e *CompContainer) (out T)

func HasComp added in v0.14.0

func HasComp[T Comp](e *CompContainer) bool

Types

type BaseComp added in v0.14.0

type BaseComp struct {
	Handle registry.Handle
}

func (BaseComp) Destroy added in v0.14.0

func (b BaseComp) Destroy()

func (*BaseComp) Init added in v0.14.0

func (b *BaseComp) Init(parentHandle registry.Handle)

func (BaseComp) Name added in v0.14.0

func (b BaseComp) Name() string

func (BaseComp) Update added in v0.14.0

func (b BaseComp) Update()

type Comp

type Comp interface {
	Name() string
	Init(parentHandle registry.Handle)
	Update()
	Destroy()
	// contains filtered or unexported methods
}

type CompContainer added in v0.18.0

type CompContainer struct {
	Comps []Comp
}

func NewCompContainer added in v0.18.0

func NewCompContainer() CompContainer

type Entity

type Entity interface {
	GetHandle() registry.Handle
}

Jump to

Keyboard shortcuts

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