controller

package
v0.0.0-...-9c8945c Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteStateInput

type DeleteStateInput struct {
	// contains filtered or unexported fields
}

func (*DeleteStateInput) Click

func (i *DeleteStateInput) Click(v *View, _ internal.Vector)

func (*DeleteStateInput) Contains

func (i *DeleteStateInput) Contains(xy internal.Vector) bool

func (*DeleteStateInput) Draw

func (i *DeleteStateInput) Draw(v *View, ctx *draw.Context)

func (DeleteStateInput) Enabled

func (DeleteStateInput) Enabled(v *View) bool

func (*DeleteStateInput) Update

func (i *DeleteStateInput) Update(world internal.BoundingBox) internal.Vector

type Deleter

type Deleter struct {
	// contains filtered or unexported fields
}

func (*Deleter) Draw

func (d *Deleter) Draw(_ *View, ctx *draw.Context)

func (*Deleter) Move

func (d *Deleter) Move(_ *View, xy internal.Vector) bool

func (*Deleter) Release

func (d *Deleter) Release(v *View, xy internal.Vector) bool

type EntityPlacer

type EntityPlacer func(box internal.BoundingBox) []*universe.Entity

type EntitySpawner

type EntitySpawner struct {
	// contains filtered or unexported fields
}

func (*EntitySpawner) Draw

func (s *EntitySpawner) Draw(_ *View, ctx *draw.Context)

func (*EntitySpawner) Move

func (s *EntitySpawner) Move(_ *View, xy internal.Vector) bool

func (*EntitySpawner) Release

func (s *EntitySpawner) Release(v *View, xy internal.Vector) bool

type Input

type Input interface {
	Update(world internal.BoundingBox) internal.Vector
	Draw(v *View, ctx *draw.Context)

	Contains(xy internal.Vector) bool
	Enabled(v *View) bool
	Click(v *View, xy internal.Vector)
}

type InputController

type InputController struct {
	// contains filtered or unexported fields
}

func NewInputController

func NewInputController(world internal.BoundingBox, inputs ...Input) *InputController

func (*InputController) Draw

func (i *InputController) Draw(v *View, ctx *draw.Context)

func (*InputController) Get

func (i *InputController) Get(v *View, xy internal.Vector) Input

func (*InputController) Update

func (i *InputController) Update(world internal.BoundingBox)

type MouseHandler

type MouseHandler interface {
	Draw(v *View, ctx *draw.Context)
	Move(v *View, xy internal.Vector) bool
	Release(v *View, xy internal.Vector) bool
}

type PlayStateInput

type PlayStateInput struct {
	// contains filtered or unexported fields
}

func (*PlayStateInput) Click

func (i *PlayStateInput) Click(v *View, _ internal.Vector)

func (*PlayStateInput) Contains

func (i *PlayStateInput) Contains(xy internal.Vector) bool

func (*PlayStateInput) Draw

func (i *PlayStateInput) Draw(v *View, ctx *draw.Context)

func (PlayStateInput) Enabled

func (PlayStateInput) Enabled(_ *View) bool

func (*PlayStateInput) Update

func (i *PlayStateInput) Update(world internal.BoundingBox) internal.Vector

type VelocityModifier

type VelocityModifier struct {
	// contains filtered or unexported fields
}

func (*VelocityModifier) Draw

func (vm *VelocityModifier) Draw(_ *View, ctx *draw.Context)

func (*VelocityModifier) Move

func (vm *VelocityModifier) Move(v *View, xy internal.Vector) bool

func (*VelocityModifier) Release

func (vm *VelocityModifier) Release(v *View, xy internal.Vector) bool

type View

type View struct {
	// contains filtered or unexported fields
}

func New

func New(initial internal.BoundingBox, collisionResolver universe.CollisionResolver) *View

func (*View) Bind

func (v *View) Bind(el js.Value)

func (*View) Camera

func (v *View) Camera() *draw.Camera

func (*View) CollisionResolver

func (v *View) CollisionResolver() universe.CollisionResolver

func (*View) Draw

func (v *View) Draw(ctx *draw.Context)

func (*View) Entities

func (v *View) Entities() *universe.EntityList

func (*View) SetCursor

func (v *View) SetCursor(cursor string)

func (*View) TimeScale

func (v *View) TimeScale() float64

func (*View) Update

func (v *View) Update(world internal.BoundingBox)

Jump to

Keyboard shortcuts

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