ecs

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

////////////////////////////////////////////////////////////////////////

Copyright (c) 2021 Vladislav Fedotov (Falldot) License: MIT License MIT License web page: https://opensource.org/licenses/MIT

////////////////////////////////////////////////////////////////////////

This file generated by Entitas-Go generator. PLEASE DO NOT EDIT IT.

Entitas-Go: github.com/Falldot/Entitas-Go

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

Copyright (c) 2021 Vladislav Fedotov (Falldot) License: MIT License MIT License web page: https://opensource.org/licenses/MIT

////////////////////////////////////////////////////////////////////////

This file generated by Entitas-Go generator. PLEASE DO NOT EDIT IT.

Entitas-Go: github.com/Falldot/Entitas-Go

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

Copyright (c) 2021 Vladislav Fedotov (Falldot) License: MIT License MIT License web page: https://opensource.org/licenses/MIT

////////////////////////////////////////////////////////////////////////

This file generated by Entitas-Go generator. PLEASE DO NOT EDIT IT.

Entitas-Go: github.com/Falldot/Entitas-Go

////////////////////////////////////////////////////////////////////////

Index

Constants

View Source
const (
	EUIDesign = iota
	ETransform2D
	EPhysics2D
	EScript //next
)
View Source
const (
	Entitas = iota
)
View Source
const EntitasComponentTotal = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	Cleaner()
}

type Collector

type Collector interface {
	Entities() []*Entity

	OnAdd() Collector
	//OnRemove() Collector
	OnUpdate() Collector

	Clear()
}

type Component

type Component interface{}

type Contexts

type Contexts []interface{}

func CreateContexts

func CreateContexts() Contexts

func SetContexts

func SetContexts(ebs ...interface{}) Contexts

func (*Contexts) Add

func (c *Contexts) Add(element interface{})

func (*Contexts) Entitas

func (c *Contexts) Entitas() EntityBase

func (*Contexts) Get

func (c *Contexts) Get(id int) interface{}

type EPhysics2DComponent

type EPhysics2DComponent struct {
	Accelx, Accely, Velx, Vely float32
	AngularAccel, Torque       float32
}

type EScriptComponent

type EScriptComponent struct {
	Handle int
}

type ETransform2DComponent

type ETransform2DComponent struct {
	X, Y     float32
	Rotation float32
}

type EUIDesignComponent

type EUIDesignComponent struct {
	Name  string
	Flags uint64
}

type Entity

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

func (*Entity) Add

func (e *Entity) Add(tp int, component Component)

func (*Entity) AddEPhysics2D

func (e *Entity) AddEPhysics2D(accely float32, velx float32, vely float32, angularaccel float32, torque float32, accelx float32)

func (*Entity) AddEScript

func (e *Entity) AddEScript(handle int)

func (*Entity) AddETransform2D

func (e *Entity) AddETransform2D(x float32, y float32, rotation float32)

func (*Entity) AddEUIDesign

func (e *Entity) AddEUIDesign(name string, flags uint64)

func (*Entity) Any

func (e *Entity) Any(tp ...int) bool

func (*Entity) Create

func (e *Entity) Create(tp int) (Component, bool)

func (*Entity) Destroy

func (e *Entity) Destroy()

func (*Entity) Get

func (e *Entity) Get(tp int) Component

func (*Entity) GetEPhysics2D

func (e *Entity) GetEPhysics2D() *EPhysics2DComponent

func (*Entity) GetEScript

func (e *Entity) GetEScript() *EScriptComponent

func (*Entity) GetETransform2D

func (e *Entity) GetETransform2D() *ETransform2DComponent

func (*Entity) GetEUIDesign

func (e *Entity) GetEUIDesign() *EUIDesignComponent

func (*Entity) Has

func (e *Entity) Has(tp ...int) bool

func (*Entity) ID

func (e *Entity) ID() int

func (*Entity) Off

func (e *Entity) Off(tp int)

func (*Entity) OffEPhysics2D

func (e *Entity) OffEPhysics2D()

func (*Entity) OffEScript

func (e *Entity) OffEScript()

func (*Entity) OffETransform2D

func (e *Entity) OffETransform2D()

func (*Entity) OffEUIDesign

func (e *Entity) OffEUIDesign()

func (*Entity) On

func (e *Entity) On(tp int)

func (*Entity) OnComponentAdd

func (e *Entity) OnComponentAdd(action func(*Entity, int, Component))

func (*Entity) OnComponentOff

func (e *Entity) OnComponentOff(action func(*Entity, int, Component))

func (*Entity) OnComponentRemoved

func (e *Entity) OnComponentRemoved(action func(*Entity, int, Component))

func (*Entity) OnComponentReplaced

func (e *Entity) OnComponentReplaced(action func(*Entity, int, Component))

func (*Entity) OnEPhysics2D

func (e *Entity) OnEPhysics2D()

func (*Entity) OnEScript

func (e *Entity) OnEScript()

func (*Entity) OnETransform2D

func (e *Entity) OnETransform2D()

func (*Entity) OnEUIDesign

func (e *Entity) OnEUIDesign()

func (*Entity) OnEntityDestroy

func (e *Entity) OnEntityDestroy(action func(*Entity))

func (*Entity) OnEntityReleased

func (e *Entity) OnEntityReleased(action func(*Entity))

func (*Entity) Remove

func (e *Entity) Remove(tp int)

func (*Entity) RemoveEPhysics2D

func (e *Entity) RemoveEPhysics2D()

func (*Entity) RemoveEScript

func (e *Entity) RemoveEScript()

func (*Entity) RemoveETransform2D

func (e *Entity) RemoveETransform2D()

func (*Entity) RemoveEUIDesign

func (e *Entity) RemoveEUIDesign()

func (*Entity) Replace

func (e *Entity) Replace(tp int, component Component)

func (*Entity) ReplaceEPhysics2D

func (e *Entity) ReplaceEPhysics2D(accely float32, velx float32, vely float32, angularaccel float32, torque float32, accelx float32)

func (*Entity) ReplaceEScript

func (e *Entity) ReplaceEScript(handle int)

func (*Entity) ReplaceETransform2D

func (e *Entity) ReplaceETransform2D(x float32, y float32, rotation float32)

func (*Entity) ReplaceEUIDesign

func (e *Entity) ReplaceEUIDesign(name string, flags uint64)

type EntityBase

type EntityBase interface {
	CreateEntity() *Entity
	Group(Matcher) Group
	Collector(Matcher) Collector

	OnGroupCreated(func(Group))

	OnEntityCreated(func(*Entity))
	OnEntityWillBeDestroyed(func(*Entity))
	OnEntityDestroyed(func(*Entity))
	// contains filtered or unexported methods
}

func CreateEntityBase

func CreateEntityBase(componentTotal int) EntityBase

type Executer

type Executer interface {
	Executer()
}

type Exiter

type Exiter interface {
	Exiter(Contexts)
}

type Group

type Group interface {
	Lenght() int
	GetEntities() []*Entity

	OnEntityAdded(func(Group, *Entity, int, Component))
	OnEntityRemoved(func(Group, *Entity, int, Component))
	OnEntityUpdate(func(Group, *Entity, int, Component))
	// contains filtered or unexported methods
}

type Initer

type Initer interface {
	Initer(Contexts)
}

type Matcher

type Matcher interface {

	/////////////////////////////////////////////////////
	//Public:
	AllOf(indices ...int) Matcher
	AnyOf(indices ...int) Matcher
	NoneOf(indices ...int) Matcher
	// contains filtered or unexported methods
}

func NewMatcher

func NewMatcher() Matcher

type Reactive

type Reactive interface {
	Trigger(contexts Contexts) Collector
	Filter(entity *Entity) bool
	Executer(entities []*Entity)
}

type Systems

type Systems interface {
	Init(contexts Contexts)
	Execute()
	Clean()
	Exit(contexts Contexts)

	Add(action interface{})
}

func CreateSystemPool

func CreateSystemPool() Systems

Jump to

Keyboard shortcuts

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