hello

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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

type Hello struct {
	Text string
	X    int
	Y    int
}

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) Flag

func (c *HelloComponent) Flag() ecs.Flag

Flag returns the

func (HelloComponent) Name

func (HelloComponent) Name() string

Name implements ecs.BaseComponent

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) UUID

func (HelloComponent) UUID() string

UUID implements ecs.BaseComponent

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) Disable

func (s *HelloSystem) Disable()

Disable system

func (*HelloSystem) Draw

func (s *HelloSystem) Draw(ctx core.DrawCtx)

Draw text via ebitenutil

func (*HelloSystem) DrawPriority

func (s *HelloSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*HelloSystem) Enable

func (s *HelloSystem) Enable()

Enable system

func (*HelloSystem) Enabled

func (s *HelloSystem) Enabled() bool

Enabled checks if enabled

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) UUID

func (HelloSystem) UUID() string

UUID implements ecs.BaseSystem

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

type Move struct {
	XSpeed float64
	YSpeed float64
	XSum   float64
	YSum   float64
}

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) Flag

func (c *MoveComponent) Flag() ecs.Flag

Flag returns the

func (MoveComponent) Name

func (MoveComponent) Name() string

Name implements ecs.BaseComponent

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) UUID

func (MoveComponent) UUID() string

UUID implements ecs.BaseComponent

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) Disable

func (s *MoveHelloSystem) Disable()

Disable system

func (*MoveHelloSystem) Draw

func (s *MoveHelloSystem) Draw(ctx core.DrawCtx)

Draw noop

func (*MoveHelloSystem) DrawPriority

func (s *MoveHelloSystem) DrawPriority(ctx core.DrawCtx)

DrawPriority noop

func (*MoveHelloSystem) Enable

func (s *MoveHelloSystem) Enable()

Enable system

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) UUID

func (MoveHelloSystem) UUID() string

UUID implements ecs.BaseSystem

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 VIMoveHelloSystem struct {
	Entity ecs.Entity

	Hello *Hello

	Move *Move
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL