ecs

package
v0.0.0-...-1ebc2e8 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: LGPL-3.0 Imports: 2 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 {
	Type() ComponentType
}

type ComponentType

type ComponentType string

type Entity

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

func (*Entity) AddComponent

func (e *Entity) AddComponent(c Component)

func (*Entity) AddComponents

func (e *Entity) AddComponents(cs ...Component)

func (*Entity) GetComponent

func (e *Entity) GetComponent(c ComponentType) Component

func (*Entity) HasComponent

func (e *Entity) HasComponent(c ComponentType) bool

func (*Entity) MarshalJSON

func (b *Entity) MarshalJSON() ([]byte, error)

func (*Entity) RemoveComponent

func (e *Entity) RemoveComponent(c ComponentType)

type EntityDto

type EntityDto map[ComponentType]Component

json marshalling

type EntityManager

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

func NewEntityManager

func NewEntityManager(entities []Entity) *EntityManager

func (*EntityManager) FindByComponents

func (em *EntityManager) FindByComponents(components ...ComponentType) []*Entity

func (*EntityManager) NewEntity

func (em *EntityManager) NewEntity() *Entity

func (*EntityManager) RemoveEntity

func (em *EntityManager) RemoveEntity(e *Entity)

func (*EntityManager) Size

func (em *EntityManager) Size() int

type System

type System interface {
	Draw(*ebiten.Image)
	Update() error
}

Jump to

Keyboard shortcuts

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