Documentation ¶
Index ¶
- Constants
- func SetHelloComponentData(w ecs.BaseWorld, e ecs.Entity, data Hello)
- func SetMoveComponentData(w ecs.BaseWorld, e ecs.Entity, data Move)
- type Hello
- type HelloComponent
- func (c *HelloComponent) Data(e ecs.Entity) *Hello
- func (c *HelloComponent) Flag() ecs.Flag
- func (HelloComponent) Name() string
- func (c *HelloComponent) Remove(e ecs.Entity)
- func (c *HelloComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (HelloComponent) UUID() string
- func (c *HelloComponent) Upsert(e ecs.Entity, data interface{})
- type HelloSystem
- func (s *HelloSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *HelloSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *HelloSystem) ComponentResized(cflag ecs.Flag)
- func (s *HelloSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *HelloSystem) Disable()
- func (s *HelloSystem) Draw(ctx core.DrawCtx)
- func (s *HelloSystem) DrawPriority(ctx core.DrawCtx)
- func (s *HelloSystem) Enable()
- func (s *HelloSystem) Enabled() bool
- func (HelloSystem) Name() string
- func (*HelloSystem) Priority() int64
- func (s *HelloSystem) Setup(w ecs.BaseWorld)
- func (HelloSystem) UUID() string
- func (s *HelloSystem) Update(ctx core.UpdateCtx)
- func (s *HelloSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *HelloSystem) V() *viewHelloSystem
- type Move
- type MoveComponent
- func (c *MoveComponent) Data(e ecs.Entity) *Move
- func (c *MoveComponent) Flag() ecs.Flag
- func (MoveComponent) Name() string
- func (c *MoveComponent) Remove(e ecs.Entity)
- func (c *MoveComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
- func (MoveComponent) UUID() string
- func (c *MoveComponent) Upsert(e ecs.Entity, data interface{})
- type MoveHelloSystem
- func (s *MoveHelloSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
- func (s *MoveHelloSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
- func (s *MoveHelloSystem) ComponentResized(cflag ecs.Flag)
- func (s *MoveHelloSystem) ComponentWillResize(cflag ecs.Flag)
- func (s *MoveHelloSystem) Disable()
- func (s *MoveHelloSystem) Draw(ctx core.DrawCtx)
- func (s *MoveHelloSystem) DrawPriority(ctx core.DrawCtx)
- func (s *MoveHelloSystem) Enable()
- func (s *MoveHelloSystem) Enabled() bool
- func (MoveHelloSystem) Name() string
- func (*MoveHelloSystem) Priority() int64
- func (s *MoveHelloSystem) Setup(w ecs.BaseWorld)
- func (MoveHelloSystem) UUID() string
- func (s *MoveHelloSystem) Update(ctx core.UpdateCtx)
- func (s *MoveHelloSystem) UpdatePriority(ctx core.UpdateCtx)
- func (s *MoveHelloSystem) V() *viewMoveHelloSystem
- type VIHelloSystem
- type VIMoveHelloSystem
- type WatchHello
- type WatchMove
Constants ¶
const SPEED float64 = 120
Variables ¶
This section is empty.
Functions ¶
func SetHelloComponentData ¶
func SetHelloComponentData(w ecs.BaseWorld, e ecs.Entity, data Hello)
SetHelloComponentData updates/adds a Hello to Entity e
func SetMoveComponentData ¶
func SetMoveComponentData(w ecs.BaseWorld, e ecs.Entity, data Move)
SetMoveComponentData updates/adds a Move to Entity e
Types ¶
type Hello ¶
func GetHelloComponentData ¶
func GetHelloComponentData(w ecs.BaseWorld, e ecs.Entity) *Hello
GetHelloComponentData gets the *Hello of Entity e
type HelloComponent ¶
type HelloComponent struct {
// contains filtered or unexported fields
}
HelloComponent implements ecs.BaseComponent
func GetHelloComponent ¶
func GetHelloComponent(w ecs.BaseWorld) *HelloComponent
GetHelloComponent returns the instance of the component in a World
func (*HelloComponent) Data ¶
func (c *HelloComponent) Data(e ecs.Entity) *Hello
func (*HelloComponent) Remove ¶
func (c *HelloComponent) Remove(e ecs.Entity)
Remove a Hello data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*HelloComponent) Setup ¶
func (c *HelloComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (*HelloComponent) Upsert ¶
func (c *HelloComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetHelloComponentData to change component data outside of a system loop.
type HelloSystem ¶
type HelloSystem struct {
// contains filtered or unexported fields
}
HelloSystem implements ecs.BaseSystem
func GetHelloSystem ¶
func GetHelloSystem(w ecs.BaseWorld) *HelloSystem
GetHelloSystem returns the instance of the system in a World
func (*HelloSystem) ComponentAdded ¶
func (s *HelloSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*HelloSystem) ComponentRemoved ¶
func (s *HelloSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*HelloSystem) ComponentResized ¶
func (s *HelloSystem) ComponentResized(cflag ecs.Flag)
func (*HelloSystem) ComponentWillResize ¶
func (s *HelloSystem) ComponentWillResize(cflag ecs.Flag)
func (*HelloSystem) DrawPriority ¶
func (s *HelloSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority noop
func (HelloSystem) Name ¶
func (HelloSystem) Name() string
func (*HelloSystem) Priority ¶
func (*HelloSystem) Priority() int64
func (*HelloSystem) Setup ¶
func (s *HelloSystem) Setup(w ecs.BaseWorld)
func (*HelloSystem) Update ¶
func (s *HelloSystem) Update(ctx core.UpdateCtx)
Update computes labes if dirty
func (*HelloSystem) UpdatePriority ¶
func (s *HelloSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*HelloSystem) V ¶
func (s *HelloSystem) V() *viewHelloSystem
type Move ¶
func GetMoveComponentData ¶
func GetMoveComponentData(w ecs.BaseWorld, e ecs.Entity) *Move
GetMoveComponentData gets the *Move of Entity e
type MoveComponent ¶
type MoveComponent struct {
// contains filtered or unexported fields
}
MoveComponent implements ecs.BaseComponent
func GetMoveComponent ¶
func GetMoveComponent(w ecs.BaseWorld) *MoveComponent
GetMoveComponent returns the instance of the component in a World
func (*MoveComponent) Data ¶
func (c *MoveComponent) Data(e ecs.Entity) *Move
func (*MoveComponent) Remove ¶
func (c *MoveComponent) Remove(e ecs.Entity)
Remove a Move data from entity e
Warning: DO NOT call remove inside the system entities loop
func (*MoveComponent) Setup ¶
func (c *MoveComponent) Setup(w ecs.BaseWorld, f ecs.Flag, key [4]byte)
Setup is called by ecs.BaseWorld
Do not call this directly
func (*MoveComponent) Upsert ¶
func (c *MoveComponent) Upsert(e ecs.Entity, data interface{})
Upsert creates or updates a component data of an entity. Not recommended to be used directly. Use SetMoveComponentData to change component data outside of a system loop.
type MoveHelloSystem ¶
type MoveHelloSystem struct {
// contains filtered or unexported fields
}
MoveHelloSystem implements ecs.BaseSystem
func GetMoveHelloSystem ¶
func GetMoveHelloSystem(w ecs.BaseWorld) *MoveHelloSystem
GetMoveHelloSystem returns the instance of the system in a World
func (*MoveHelloSystem) ComponentAdded ¶
func (s *MoveHelloSystem) ComponentAdded(e ecs.Entity, eflag ecs.Flag)
func (*MoveHelloSystem) ComponentRemoved ¶
func (s *MoveHelloSystem) ComponentRemoved(e ecs.Entity, eflag ecs.Flag)
func (*MoveHelloSystem) ComponentResized ¶
func (s *MoveHelloSystem) ComponentResized(cflag ecs.Flag)
func (*MoveHelloSystem) ComponentWillResize ¶
func (s *MoveHelloSystem) ComponentWillResize(cflag ecs.Flag)
func (*MoveHelloSystem) DrawPriority ¶
func (s *MoveHelloSystem) DrawPriority(ctx core.DrawCtx)
DrawPriority noop
func (*MoveHelloSystem) Enabled ¶
func (s *MoveHelloSystem) Enabled() bool
Enabled checks if enabled
func (MoveHelloSystem) Name ¶
func (MoveHelloSystem) Name() string
func (*MoveHelloSystem) Priority ¶
func (*MoveHelloSystem) Priority() int64
func (*MoveHelloSystem) Setup ¶
func (s *MoveHelloSystem) Setup(w ecs.BaseWorld)
func (*MoveHelloSystem) Update ¶
func (s *MoveHelloSystem) Update(ctx core.UpdateCtx)
Update positions
func (*MoveHelloSystem) UpdatePriority ¶
func (s *MoveHelloSystem) UpdatePriority(ctx core.UpdateCtx)
UpdatePriority noop
func (*MoveHelloSystem) V ¶
func (s *MoveHelloSystem) V() *viewMoveHelloSystem
type VIHelloSystem ¶
type VIHelloSystem struct { Entity ecs.Entity Hello *Hello }
type VIMoveHelloSystem ¶
type WatchHello ¶
type WatchHello interface { Entity() ecs.Entity Data() *Hello }
WatchHello is a helper struct to access a valid pointer of Hello
func WatchHelloComponentData ¶
func WatchHelloComponentData(w ecs.BaseWorld, e ecs.Entity) WatchHello
WatchHelloComponentData gets a pointer getter of an entity's Hello.
The pointer must not be stored because it may become invalid overtime.
type WatchMove ¶
type WatchMove interface { Entity() ecs.Entity Data() *Move }
WatchMove is a helper struct to access a valid pointer of Move
func WatchMoveComponentData ¶
func WatchMoveComponentData(w ecs.BaseWorld, e ecs.Entity) WatchMove
WatchMoveComponentData gets a pointer getter of an entity's Move.
The pointer must not be stored because it may become invalid overtime.