Documentation ¶
Index ¶
- type ComponentBase
- type ComponentType
- type Entity
- func (s *Entity) ComponentCombId() uint64
- func (s *Entity) DelComponent(c ...IComponent)
- func (s *Entity) GetAllComponent() map[ComponentType]IComponent
- func (s *Entity) GetComponent(t ComponentType) IComponent
- func (s *Entity) Id() string
- func (s *Entity) RangeComponent(f func(ComponentType, IComponent), ts ...ComponentType)
- func (s *Entity) ResetComponent()
- func (s *Entity) SetComponent(c ...IComponent)
- func (s *Entity) SetId(eid string)
- func (s *Entity) SetType(t int64)
- func (s *Entity) Type() int64
- type EntityCollection
- type IComponent
- type ITuple
- type Runtime
- func (s *Runtime) AddEntity(ent *Entity) error
- func (s *Runtime) AddSingleComponent(components ...IComponent) error
- func (s *Runtime) AddSystem(news ...System) error
- func (s *Runtime) DeleteEntity(eid string) bool
- func (s *Runtime) GetEntity(eid string) *Entity
- func (s *Runtime) RangeSystem(f func(System) bool)
- func (s *Runtime) Run(dt float64, time_set map[string]int64) int64
- func (s *Runtime) SingleComponent(componentType ComponentType) IComponent
- type System
- type SystemBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentBase ¶
type ComponentBase struct {
// contains filtered or unexported fields
}
func (*ComponentBase) EId ¶
func (s *ComponentBase) EId() string
func (*ComponentBase) Init ¶
func (s *ComponentBase) Init(EId string)
type ComponentType ¶
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (*Entity) ComponentCombId ¶
func (*Entity) DelComponent ¶
func (s *Entity) DelComponent(c ...IComponent)
func (*Entity) GetAllComponent ¶
func (s *Entity) GetAllComponent() map[ComponentType]IComponent
func (*Entity) GetComponent ¶
func (s *Entity) GetComponent(t ComponentType) IComponent
func (*Entity) RangeComponent ¶
func (s *Entity) RangeComponent(f func(ComponentType, IComponent), ts ...ComponentType)
func (*Entity) ResetComponent ¶
func (s *Entity) ResetComponent()
type EntityCollection ¶
type EntityCollection struct {
// contains filtered or unexported fields
}
type IComponent ¶
type IComponent interface { Type() ComponentType EId() string Init(EId string) }
type ITuple ¶
type ITuple interface {
Init(comps map[ComponentType]IComponent)
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime() *Runtime
func (*Runtime) AddSingleComponent ¶
func (s *Runtime) AddSingleComponent(components ...IComponent) error
func (*Runtime) DeleteEntity ¶
entity operate : delete
func (*Runtime) RangeSystem ¶
func (*Runtime) SingleComponent ¶
func (s *Runtime) SingleComponent(componentType ComponentType) IComponent
type SystemBase ¶
type SystemBase struct {
// contains filtered or unexported fields
}
func NewSystemBase ¶
func NewSystemBase(t string, rt *Runtime, tt reflect.Type) *SystemBase
func (*SystemBase) GetTuple ¶
func (s *SystemBase) GetTuple(EId string) ITuple
func (*SystemBase) Runtime ¶
func (s *SystemBase) Runtime() *Runtime
func (*SystemBase) Type ¶
func (s *SystemBase) Type() string
Click to show internal directories.
Click to hide internal directories.