Documentation ¶
Index ¶
- Constants
- func Add[T any](e *Entity) *T
- func DefineTypeComponent[T any, C any](t *Data[T], c *Data[C], get func(data *T) *C)
- func Get[T any](e *Entity) *T
- func HasActiveWorld() bool
- func Set[T any](e *Entity, value T) bool
- type ArrangementID
- type Context
- type Data
- func (d *Data[V]) Add(e *Entity) *V
- func (d *Data[V]) AddSystem(sys DataSystem[V])
- func (d *Data[D]) Enable(settings DataSettings)
- func (d *Data[V]) Get(e *Entity) *V
- func (d Data[V]) ID() DataID
- func (d *Data[V]) Iterable() ds.Iterable[Value[*V]]
- func (d Data[V]) Name() string
- func (d *Data[V]) Set(e *Entity, value V)
- func (d *Data[V]) SetSystem(sys DataSystem[V]) *Data[V]
- type DataBase
- type DataID
- type DataIDs
- type DataOffset
- type DataSettings
- type DataSystem
- type Entity
- func (e *Entity) Delete()
- func (e Entity) Deleted() bool
- func (e Entity) Has(comp DataBase) bool
- func (e Entity) HasLive(comp DataBase) bool
- func (e Entity) HasStaging(comp DataBase) bool
- func (e Entity) ID() ID
- func (e Entity) Live() bool
- func (e Entity) LiveDatas() DataIDs
- func (e Entity) LiveValues() DataIDs
- func (e Entity) Staging() bool
- func (e Entity) StagingValues() DataIDs
- func (e Entity) Values() DataIDs
- type ID
- type System
- type Tree
- func (t *Tree) AddChild(child *Entity)
- func (t *Tree) AddChildTree(child *Tree)
- func (t *Tree) Children() []*Entity
- func (t *Tree) Delete()
- func (t *Tree) DeleteChildren()
- func (t *Tree) Entity() *Entity
- func (t *Tree) Parent() *Entity
- func (t *Tree) RemoveChild(child *Entity)
- func (t *Tree) SetParent(parent *Entity)
- func (t *Tree) SetParentTree(parent *Tree)
- type Value
- type World
- func (w *World) Activate()
- func (w *World) AddSystem(sys System)
- func (w *World) Delete(e *Entity)
- func (w *World) Destroy()
- func (w *World) Enable(settings DataSettings, datas ...DataBase)
- func (w *World) Init() error
- func (w *World) IsActive() bool
- func (w *World) Iterable() ds.Iterable[Entity]
- func (w *World) New() *Entity
- func (w *World) Search(search WorldSearch) ds.Iterable[Entity]
- func (w *World) Stage()
- func (w *World) Update()
- type WorldSearch
- type WorldSettings
Constants ¶
View Source
const DATA_MAX = 64
Variables ¶
This section is empty.
Functions ¶
func DefineTypeComponent ¶
func HasActiveWorld ¶
func HasActiveWorld() bool
Types ¶
type ArrangementID ¶
type ArrangementID uint16
type Data ¶
type Data[D any] struct { // contains filtered or unexported fields }
func DefineComponent ¶
func (*Data[V]) AddSystem ¶
func (d *Data[V]) AddSystem(sys DataSystem[V])
func (*Data[D]) Enable ¶
func (d *Data[D]) Enable(settings DataSettings)
func (*Data[V]) SetSystem ¶
func (d *Data[V]) SetSystem(sys DataSystem[V]) *Data[V]
type DataBase ¶
type DataBase interface { ID() DataID Name() string Enable(settings DataSettings) }
type DataIDs ¶
type DataIDs = ds.Bits64Indexed[DataID]
type DataOffset ¶
type DataOffset uint32
type DataSettings ¶
type DataSystem ¶
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (Entity) HasStaging ¶
func (Entity) LiveValues ¶
func (Entity) StagingValues ¶
type System ¶
type System interface { OnStage(e *Entity, ctx Context) OnLive(e *Entity, ctx Context) OnDelete(e *Entity, ctx Context) Init(ctx Context) error Update(iter ds.Iterable[Entity], ctx Context) Destroy(ctx Context) }
func NewSystemFiltered ¶
func NewSystemFiltered(sys System, filter WorldSearch) System
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (*Tree) AddChildTree ¶
func (*Tree) DeleteChildren ¶
func (t *Tree) DeleteChildren()
func (*Tree) RemoveChild ¶
func (*Tree) SetParentTree ¶
type World ¶
type World struct { Settings WorldSettings Name string // contains filtered or unexported fields }
func ActiveWorld ¶
func ActiveWorld() *World
func NewWorld ¶
func NewWorld(name string, settings WorldSettings) *World
func (*World) Enable ¶
func (w *World) Enable(settings DataSettings, datas ...DataBase)
type WorldSearch ¶
func (WorldSearch) IsMatch ¶
func (search WorldSearch) IsMatch(e *Entity) bool
type WorldSettings ¶
type WorldSettings struct { EntityCapacity uint32 EntityStageCapacity uint32 AverageComponentPerEntity uint32 DeleteOnDestroy bool }
func (WorldSettings) IsZero ¶
func (ws WorldSettings) IsZero() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.