Documentation ¶
Index ¶
- type ActiveControlComponentData
- type ActiveControlSystem
- type AnimateComponentData
- type AnimateSystem
- type AnimationComponentDataCore
- type CollideSystem
- type CollisionComponentData
- type CollisionCoreData
- type CommonSystemData
- type ComponentData
- type ECSManager
- func (e *ECSManager) AddComponentToEntity(entityID uint64, componentID uint16)
- func (e *ECSManager) GetComponentDataByID(entityID uint64, componentID uint16) interface{}
- func (e *ECSManager) GetComponentDataByName(entityID uint64, componentName string) interface{}
- func (e *ECSManager) GetComponentID(componentName string) uint16
- func (e *ECSManager) GetComponentIDAsStr(componentName string) string
- func (e *ECSManager) GetEntityComponentKey(entityID uint64, componentName string) string
- func (e *ECSManager) GetEntityIDBoundariesFromEntityRange(entityIDStr string) *[2]uint64
- func (e *ECSManager) GetEntityRect(entityID uint64) *sdl.Rect
- func (e *ECSManager) HasComponent(components []uint16, componentID uint16) bool
- func (e *ECSManager) HasNamedComponent(components []uint16, componentName string) bool
- func (e *ECSManager) InitializeComponentsForEntity(entityID uint64)
- func (e *ECSManager) LinkComponentsWithProperDataStruct()
- type GravityComponentData
- type GravitySystem
- type RenderComponentData
- type RenderSystem
- type SideScrollComponentData
- type SideScrollSystem
- type System
- type TransformComponentData
- type TransformSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveControlComponentData ¶
type ActiveControlComponentData struct { }
type ActiveControlSystem ¶
type ActiveControlSystem struct { *CommonSystemData Keyboard *input.Keyboard }
func NewActiveControlSystem ¶
func NewActiveControlSystem(e *ECSManager, k *input.Keyboard) *ActiveControlSystem
func (*ActiveControlSystem) Run ¶
func (sys *ActiveControlSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*ActiveControlSystem) UpdateComponent ¶
func (sys *ActiveControlSystem) UpdateComponent(delta float64, essentialData ...interface{})
type AnimateComponentData ¶
type AnimateComponentData struct { // The string key is the animation's name such as "Idle", "Walk" etc... AnimationData *map[string]*AnimationComponentDataCore LastAnimation string }
type AnimateSystem ¶
type AnimateSystem struct {
*CommonSystemData
}
func NewAnimateSystem ¶
func NewAnimateSystem(e *ECSManager) *AnimateSystem
func (*AnimateSystem) Run ¶
func (sys *AnimateSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*AnimateSystem) UpdateComponent ¶
func (sys *AnimateSystem) UpdateComponent(delta float64, essentialData ...interface{})
type CollideSystem ¶
type CollideSystem struct {
*CommonSystemData
}
func NewCollideSystem ¶
func NewCollideSystem(e *ECSManager) *CollideSystem
func (*CollideSystem) Run ¶
func (sys *CollideSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*CollideSystem) UpdateComponent ¶
func (sys *CollideSystem) UpdateComponent(delta float64, essentialData ...interface{})
type CollisionComponentData ¶
type CollisionComponentData struct {
*CollisionCoreData
}
type CollisionCoreData ¶
type CommonSystemData ¶
type CommonSystemData struct { SystemID uint16 ECSManager *ECSManager }
func NewCommonSystemData ¶
func NewCommonSystemData(componentName string, ecsManager *ECSManager) *CommonSystemData
func (*CommonSystemData) GetComponentData ¶
func (bs *CommonSystemData) GetComponentData(entityID uint64) interface{}
type ComponentData ¶
type ComponentData struct {
Data interface{}
}
type ECSManager ¶
type ECSManager struct { EntityToComponentMap *orderedmap.OrderedMap EntityComponentStringToComponentDataMap map[string]*ComponentData ComponentIDStorage map[string]uint16 ComponentData *ComponentData Systems []System }
func NewECSManager ¶
func NewECSManager() *ECSManager
func (*ECSManager) AddComponentToEntity ¶
func (e *ECSManager) AddComponentToEntity(entityID uint64, componentID uint16)
func (*ECSManager) GetComponentDataByID ¶
func (e *ECSManager) GetComponentDataByID(entityID uint64, componentID uint16) interface{}
func (*ECSManager) GetComponentDataByName ¶
func (e *ECSManager) GetComponentDataByName(entityID uint64, componentName string) interface{}
func (*ECSManager) GetComponentID ¶
func (e *ECSManager) GetComponentID(componentName string) uint16
func (*ECSManager) GetComponentIDAsStr ¶
func (e *ECSManager) GetComponentIDAsStr(componentName string) string
func (*ECSManager) GetEntityComponentKey ¶
func (e *ECSManager) GetEntityComponentKey(entityID uint64, componentName string) string
func (*ECSManager) GetEntityIDBoundariesFromEntityRange ¶
func (e *ECSManager) GetEntityIDBoundariesFromEntityRange(entityIDStr string) *[2]uint64
func (*ECSManager) GetEntityRect ¶
func (e *ECSManager) GetEntityRect(entityID uint64) *sdl.Rect
func (*ECSManager) HasComponent ¶
func (e *ECSManager) HasComponent(components []uint16, componentID uint16) bool
func (*ECSManager) HasNamedComponent ¶
func (e *ECSManager) HasNamedComponent(components []uint16, componentName string) bool
func (*ECSManager) InitializeComponentsForEntity ¶
func (e *ECSManager) InitializeComponentsForEntity(entityID uint64)
func (*ECSManager) LinkComponentsWithProperDataStruct ¶
func (e *ECSManager) LinkComponentsWithProperDataStruct()
type GravityComponentData ¶
type GravityComponentData struct{}
type GravitySystem ¶
type GravitySystem struct {
*CommonSystemData
}
func NewGravitySystem ¶
func NewGravitySystem(e *ECSManager) *GravitySystem
func (*GravitySystem) Run ¶
func (sys *GravitySystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*GravitySystem) UpdateComponent ¶
func (sys *GravitySystem) UpdateComponent(delta float64, essentialData ...interface{})
type RenderComponentData ¶
type RenderSystem ¶
type RenderSystem struct { *CommonSystemData Renderer *sdl.Renderer // contains filtered or unexported fields }
func NewRenderSystem ¶
func NewRenderSystem(e *ECSManager, renderer *sdl.Renderer) *RenderSystem
func (*RenderSystem) Run ¶
func (sys *RenderSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*RenderSystem) UpdateComponent ¶
func (sys *RenderSystem) UpdateComponent(delta float64, essentialData ...interface{})
type SideScrollComponentData ¶
type SideScrollComponentData struct {
// contains filtered or unexported fields
}
type SideScrollSystem ¶
type SideScrollSystem struct {
*CommonSystemData
}
func NewSideScrollSystem ¶
func NewSideScrollSystem(e *ECSManager) *SideScrollSystem
func (*SideScrollSystem) Run ¶
func (sys *SideScrollSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*SideScrollSystem) UpdateComponent ¶
func (sys *SideScrollSystem) UpdateComponent(delta float64, essentialData ...interface{})
type System ¶
type System interface { Run(delta float64, statemachine *statemachine.StateMachine) UpdateComponent(float64, ...interface{}) }
type TransformComponentData ¶
type TransformSystem ¶
type TransformSystem struct {
*CommonSystemData
}
func NewTransformSystem ¶
func NewTransformSystem(e *ECSManager) *TransformSystem
func (*TransformSystem) Run ¶
func (sys *TransformSystem) Run(delta float64, statemachine *statemachine.StateMachine)
func (*TransformSystem) UpdateComponent ¶
func (sys *TransformSystem) UpdateComponent(delta float64, essentialData ...interface{})
Click to show internal directories.
Click to hide internal directories.