Documentation ¶
Index ¶
- func CreateECS(updateTime int64, timeScale float32, server bool) lokas.IRuntime
- func CreateEntity() lokas.IEntity
- func GetComponentName(ecs lokas.IRuntime, c Component) string
- func GetComponentSyncAble(ecs lokas.IRuntime, c interface{}) bool
- func HasEntityInSlice(slice []*Entity, e *Entity) bool
- func NewComponentPool(creator ComponentCreator, comp lokas.IComponent) lokas.IComponentPool
- type Component
- func (this *Component) Dirty() bool
- func (this *Component) GetComponentName() string
- func (this *Component) GetEntity() lokas.IEntity
- func (this *Component) GetRuntime() lokas.IRuntime
- func (this *Component) GetSibling(t protocol.BINARY_TAG) lokas.IComponent
- func (this *Component) SetDirty(d bool)
- func (this *Component) SetEntity(e lokas.IEntity)
- func (this *Component) SetRuntime(r lokas.IRuntime)
- type ComponentCreator
- type ComponentPool
- func (this *ComponentPool) Create(args ...interface{}) lokas.IComponent
- func (this *ComponentPool) Destroy()
- func (this *ComponentPool) Get() lokas.IComponent
- func (this *ComponentPool) Pop() lokas.IComponent
- func (this *ComponentPool) PopAndDestroy()
- func (this *ComponentPool) Recycle(comp lokas.IComponent)
- type Entity
- func (this *Entity) Add(c lokas.IComponent)
- func (this *Entity) AddByTag(t protocol.BINARY_TAG) lokas.IComponent
- func (this *Entity) Clone() *Entity
- func (this *Entity) Components() map[protocol.BINARY_TAG]lokas.IComponent
- func (this *Entity) Dirty() bool
- func (this *Entity) Get(t protocol.BINARY_TAG) lokas.IComponent
- func (this *Entity) GetId() util.ID
- func (this *Entity) GetOrCreate(t protocol.BINARY_TAG) lokas.IComponent
- func (this *Entity) Includes(componentTypeArray []reflect.Type) bool
- func (this *Entity) Init()
- func (this *Entity) MarkDirty(c lokas.IComponent)
- func (this *Entity) MarkDirtyByName(name string)
- func (this *Entity) Remove(t protocol.BINARY_TAG) lokas.IComponent
- func (this *Entity) RemoveAll()
- func (this *Entity) SetDirty(d bool)
- func (this *Entity) SetId(id util.ID)
- type EntityRef
- type Group
- type Runtime
- func (this *Runtime) CreateEntity() lokas.IEntity
- func (this *Runtime) CurrentTick() int64
- func (this *Runtime) GetComponentType(name string) reflect.Type
- func (this *Runtime) GetContext(name string) interface{}
- func (this *Runtime) GetEntity(id util.ID) lokas.IEntity
- func (this *Runtime) GetTimeScale() float32
- func (this *Runtime) Init(updateTime int64, timeScale float32, server bool)
- func (this *Runtime) IsServer() bool
- func (this *Runtime) IsSyncAble(compName string) bool
- func (this *Runtime) MarkDirtyEntity(e lokas.IEntity)
- func (this *Runtime) RegisterComponent(name string, c lokas.IComponent)
- func (this *Runtime) RegisterSingleton(name string, c lokas.IComponent)
- func (this *Runtime) RunningTime() int64
- func (this *Runtime) SetContext(name string, value interface{})
- func (this *Runtime) SetTimeScale(scale float32)
- func (this *Runtime) Start()
- func (this *Runtime) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEntity ¶
func CreateEntity() lokas.IEntity
func GetComponentName ¶
func GetComponentSyncAble ¶
func GetComponentSyncAble(ecs lokas.IRuntime, c interface{}) bool
func HasEntityInSlice ¶
func NewComponentPool ¶
func NewComponentPool(creator ComponentCreator, comp lokas.IComponent) lokas.IComponentPool
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func (*Component) GetComponentName ¶
func (*Component) GetRuntime ¶
func (this *Component) GetRuntime() lokas.IRuntime
func (*Component) GetSibling ¶
func (this *Component) GetSibling(t protocol.BINARY_TAG) lokas.IComponent
func (*Component) SetRuntime ¶
func (this *Component) SetRuntime(r lokas.IRuntime)
type ComponentCreator ¶
type ComponentCreator func(args ...interface{}) lokas.IComponent
type ComponentPool ¶
type ComponentPool struct {
// contains filtered or unexported fields
}
func (*ComponentPool) Create ¶
func (this *ComponentPool) Create(args ...interface{}) lokas.IComponent
func (*ComponentPool) Destroy ¶
func (this *ComponentPool) Destroy()
func (*ComponentPool) Get ¶
func (this *ComponentPool) Get() lokas.IComponent
func (*ComponentPool) Pop ¶
func (this *ComponentPool) Pop() lokas.IComponent
func (*ComponentPool) PopAndDestroy ¶
func (this *ComponentPool) PopAndDestroy()
func (*ComponentPool) Recycle ¶
func (this *ComponentPool) Recycle(comp lokas.IComponent)
type Entity ¶
type Entity struct { events.EventEmmiter // contains filtered or unexported fields }
func (*Entity) AddByTag ¶
func (this *Entity) AddByTag(t protocol.BINARY_TAG) lokas.IComponent
func (*Entity) Components ¶
func (this *Entity) Components() map[protocol.BINARY_TAG]lokas.IComponent
func (*Entity) Get ¶
func (this *Entity) Get(t protocol.BINARY_TAG) lokas.IComponent
func (*Entity) GetOrCreate ¶ added in v0.0.6
func (this *Entity) GetOrCreate(t protocol.BINARY_TAG) lokas.IComponent
func (*Entity) MarkDirtyByName ¶
func (*Entity) Remove ¶
func (this *Entity) Remove(t protocol.BINARY_TAG) lokas.IComponent
type Group ¶
func CreateGroup ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) CreateEntity ¶
func (this *Runtime) CreateEntity() lokas.IEntity
func (*Runtime) CurrentTick ¶
func (*Runtime) GetContext ¶
func (*Runtime) GetTimeScale ¶
func (*Runtime) IsSyncAble ¶
func (*Runtime) MarkDirtyEntity ¶ added in v0.0.2
func (this *Runtime) MarkDirtyEntity(e lokas.IEntity)
func (*Runtime) RegisterComponent ¶
func (*Runtime) RegisterSingleton ¶
func (*Runtime) RunningTime ¶
func (*Runtime) SetContext ¶
func (*Runtime) SetTimeScale ¶
Click to show internal directories.
Click to hide internal directories.