entity

package
v0.0.0-...-3b1d20f Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Update(time, elapsed float64)
	Render()
}

Component Interface

type Entity

type Entity struct {
	Components map[string]Component
	Active     bool
	Index      uint32
	Position   mgl32.Vec3
	Rotation   mgl32.Mat3
}

Entity that holds entities

func (*Entity) AddComponent

func (ent *Entity) AddComponent(componentName string, component Component) *Entity

AddComponent attaches new component to the manager

func (*Entity) GetComponent

func (ent *Entity) GetComponent(componentName string) Component

GetComponent .

func (*Entity) GetComponentList

func (ent *Entity) GetComponentList() map[string]Component

GetComponentList .

func (*Entity) Render

func (ent *Entity) Render()

func (*Entity) SetPosition

func (ent *Entity) SetPosition(pos mgl32.Vec3)

SetPosition setter

func (*Entity) Update

func (ent *Entity) Update(time, elapsed float64)

Update method for blah ...

type Manager

type Manager struct {
	Entities map[string]Entity
}

func (*Manager) GetEntities

func (m *Manager) GetEntities() map[string]Entity

GetEntities .

func (*Manager) GetEntity

func (m *Manager) GetEntity(entityName string) Entity

GetEntity .

func (*Manager) RegisterEntity

func (m *Manager) RegisterEntity(entityName string, ent Entity) Entity

Jump to

Keyboard shortcuts

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