Documentation
¶
Overview ¶
Code generated by ecs https://github.com/gabstv/ecs; DO NOT EDIT.
Index ¶
- func GetPositionComponentFlag(w ecs.World) ecs.Flag
- func GetRotationComponentFlag(w ecs.World) ecs.Flag
- func GetVelocityComponentFlag(w ecs.World) ecs.Flag
- func SetPositionComponentData(w ecs.World, e ecs.Entity, data Position)
- func SetRotationComponentData(w ecs.World, e ecs.Entity, data Rotation)
- func SetVelocityComponentData(w ecs.World, e ecs.Entity, data Velocity)
- type MovementSystem
- func (s *MovementSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *MovementSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *MovementSystem) ComponentResized(cflag ecs.Flag)
- func (s *MovementSystem) ComponentWillResize(cflag ecs.Flag)
- func (MovementSystem) Name() string
- func (s *MovementSystem) Priority() int64
- func (s *MovementSystem) Setup(w ecs.World)
- func (MovementSystem) UUID() string
- func (s *MovementSystem) Update(dt float64)
- func (s *MovementSystem) V() *viewMovementSystem
- func (s *MovementSystem) View() *viewMovementSystem
- type Position
- type PositionComponent
- func (c *PositionComponent) Data(e ecs.Entity) *Position
- func (c *PositionComponent) Flag() ecs.Flag
- func (PositionComponent) Name() string
- func (c *PositionComponent) Remove(e ecs.Entity) bool
- func (c *PositionComponent) Setup(w ecs.World, f ecs.Flag, key [4]byte)
- func (PositionComponent) UUID() string
- func (c *PositionComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
- func (c *PositionComponent) World() ecs.World
- type PositionComponentObserver
- type Rotation
- type RotationComponent
- func (c *RotationComponent) Data(e ecs.Entity) *Rotation
- func (c *RotationComponent) Flag() ecs.Flag
- func (RotationComponent) Name() string
- func (c *RotationComponent) Remove(e ecs.Entity) bool
- func (c *RotationComponent) Setup(w ecs.World, f ecs.Flag, key [4]byte)
- func (RotationComponent) UUID() string
- func (c *RotationComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
- func (c *RotationComponent) World() ecs.World
- type RotationComponentObserver
- type System
- type VIMovementSystem
- type Velocity
- type VelocityComponent
- func (c *VelocityComponent) Data(e ecs.Entity) *Velocity
- func (c *VelocityComponent) Flag() ecs.Flag
- func (VelocityComponent) Name() string
- func (c *VelocityComponent) Remove(e ecs.Entity) bool
- func (c *VelocityComponent) Setup(w ecs.World, f ecs.Flag, key [4]byte)
- func (VelocityComponent) UUID() string
- func (c *VelocityComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
- func (c *VelocityComponent) World() ecs.World
- type VelocityComponentObserver
- type World
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPositionComponentFlag ¶
GetPositionComponentFlag returns the flag of this component
func GetRotationComponentFlag ¶
GetRotationComponentFlag returns the flag of this component
func GetVelocityComponentFlag ¶
GetVelocityComponentFlag returns the flag of this component
func SetPositionComponentData ¶
SetPositionComponentData updates/adds a Position to Entity e
func SetRotationComponentData ¶
SetRotationComponentData updates/adds a Rotation to Entity e
Types ¶
type MovementSystem ¶
type MovementSystem struct {
ecs.BaseSystem
// contains filtered or unexported fields
}
MovementSystem implements ecs.System
func GetMovementSystem ¶
func GetMovementSystem(w ecs.World) *MovementSystem
GetMovementSystem returns the instance of the system in a World
func (*MovementSystem) ComponentAdded ¶
func (s *MovementSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*MovementSystem) ComponentRemoved ¶
func (s *MovementSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*MovementSystem) ComponentResized ¶
func (s *MovementSystem) ComponentResized(cflag ecs.Flag)
func (*MovementSystem) ComponentWillResize ¶
func (s *MovementSystem) ComponentWillResize(cflag ecs.Flag)
func (*MovementSystem) Priority ¶
func (s *MovementSystem) Priority() int64
func (*MovementSystem) Setup ¶
func (s *MovementSystem) Setup(w ecs.World)
func (*MovementSystem) Update ¶
func (s *MovementSystem) Update(dt float64)
Update MovementSystem matches
ecs:system uuid:E7D2FB64-2E98-4A14-8DE6-F088DE2AC3FB name:MovementSystem components: Position, Rotation, Velocity
member: lastdt float64
entityadded: onEntityAdded entityremoved: onEntityRemoved componentwillresize: onComponentWillResize componentresized: onComponentResized setup: onSetup
func (*MovementSystem) V ¶
func (s *MovementSystem) V() *viewMovementSystem
func (*MovementSystem) View ¶
func (s *MovementSystem) View() *viewMovementSystem
type PositionComponent ¶
type PositionComponent struct {
// contains filtered or unexported fields
}
PositionComponent handles the component logic of the Position. Implements ecs.Component
func GetPositionComponent ¶
func GetPositionComponent(w ecs.World) *PositionComponent
GetPositionComponent returns the instance of the component in a World
func (*PositionComponent) Data ¶
func (c *PositionComponent) Data(e ecs.Entity) *Position
Data retrieves the *Position of entity e. Warning: volatile pointer (do not store)
func (*PositionComponent) Flag ¶
func (c *PositionComponent) Flag() ecs.Flag
Flag returns the flag of this component
func (PositionComponent) Name ¶
func (PositionComponent) Name() string
Name implements ecs.Component
func (*PositionComponent) Remove ¶
func (c *PositionComponent) Remove(e ecs.Entity) bool
Remove a Position data from entity e Returns false if the component was not present in Entity e
func (PositionComponent) UUID ¶
func (PositionComponent) UUID() string
UUID implements ecs.Component
func (*PositionComponent) Upsert ¶
func (c *PositionComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetPositionComponentData to change component data outside of a system loop.
func (*PositionComponent) World ¶
func (c *PositionComponent) World() ecs.World
World implements ecs.Component
type PositionComponentObserver ¶
PositionComponentObserver is a helper struct to access a valid pointer of Position
func WatchPositionComponentData ¶
func WatchPositionComponentData(w ecs.World, e ecs.Entity) PositionComponentObserver
WatchPositionComponentData gets a pointer getter of an entity's Position. The pointer must not be stored because it may become invalid over time.
type Rotation ¶
type Rotation struct {
Radians float64
}
Rotation component
ecs:component uuid:55AFAC07-F446-4DBE-B963-413B0C38E72B
type RotationComponent ¶
type RotationComponent struct {
// contains filtered or unexported fields
}
RotationComponent handles the component logic of the Rotation. Implements ecs.Component
func GetRotationComponent ¶
func GetRotationComponent(w ecs.World) *RotationComponent
GetRotationComponent returns the instance of the component in a World
func (*RotationComponent) Data ¶
func (c *RotationComponent) Data(e ecs.Entity) *Rotation
Data retrieves the *Rotation of entity e. Warning: volatile pointer (do not store)
func (*RotationComponent) Flag ¶
func (c *RotationComponent) Flag() ecs.Flag
Flag returns the flag of this component
func (RotationComponent) Name ¶
func (RotationComponent) Name() string
Name implements ecs.Component
func (*RotationComponent) Remove ¶
func (c *RotationComponent) Remove(e ecs.Entity) bool
Remove a Rotation data from entity e Returns false if the component was not present in Entity e
func (RotationComponent) UUID ¶
func (RotationComponent) UUID() string
UUID implements ecs.Component
func (*RotationComponent) Upsert ¶
func (c *RotationComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetRotationComponentData to change component data outside of a system loop.
func (*RotationComponent) World ¶
func (c *RotationComponent) World() ecs.World
World implements ecs.Component
type RotationComponentObserver ¶
RotationComponentObserver is a helper struct to access a valid pointer of Rotation
func WatchRotationComponentData ¶
func WatchRotationComponentData(w ecs.World, e ecs.Entity) RotationComponentObserver
WatchRotationComponentData gets a pointer getter of an entity's Rotation. The pointer must not be stored because it may become invalid over time.
type VIMovementSystem ¶
type Velocity ¶
Velocity component
ecs:component the uuid for this component is generated automatically
type VelocityComponent ¶
type VelocityComponent struct {
// contains filtered or unexported fields
}
VelocityComponent handles the component logic of the Velocity. Implements ecs.Component
func GetVelocityComponent ¶
func GetVelocityComponent(w ecs.World) *VelocityComponent
GetVelocityComponent returns the instance of the component in a World
func (*VelocityComponent) Data ¶
func (c *VelocityComponent) Data(e ecs.Entity) *Velocity
Data retrieves the *Velocity of entity e. Warning: volatile pointer (do not store)
func (*VelocityComponent) Flag ¶
func (c *VelocityComponent) Flag() ecs.Flag
Flag returns the flag of this component
func (VelocityComponent) Name ¶
func (VelocityComponent) Name() string
Name implements ecs.Component
func (*VelocityComponent) Remove ¶
func (c *VelocityComponent) Remove(e ecs.Entity) bool
Remove a Velocity data from entity e Returns false if the component was not present in Entity e
func (VelocityComponent) UUID ¶
func (VelocityComponent) UUID() string
UUID implements ecs.Component
func (*VelocityComponent) Upsert ¶
func (c *VelocityComponent) Upsert(e ecs.Entity, data interface{}) (added bool)
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetVelocityComponentData to change component data outside of a system loop.
func (*VelocityComponent) World ¶
func (c *VelocityComponent) World() ecs.World
World implements ecs.Component
type VelocityComponentObserver ¶
VelocityComponentObserver is a helper struct to access a valid pointer of Velocity
func WatchVelocityComponentData ¶
func WatchVelocityComponentData(w ecs.World, e ecs.Entity) VelocityComponentObserver
WatchVelocityComponentData gets a pointer getter of an entity's Velocity. The pointer must not be stored because it may become invalid over time.