components

package
v0.0.0-...-7004f9a Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CameraName = "camera"
)
View Source
const (
	ControlName = "control"
)
View Source
const (
	DrawableName = "drawable"
)

DrawableName is the name of the component.

View Source
const (
	FocusName = "focus"
)
View Source
const (
	InitiativeName = "initiative"
)
View Source
const (
	MovementName = "movement"
)
View Source
const (
	PhysicsName = "physics"
)
View Source
const (
	PlayerName = "player"
)
View Source
const (
	PositionName = "position"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	GetAction(obj object.GameObject, worldMap cartography.Map) func()
}

type Camera

type Camera struct {
	SightRadius int
	Memory      []structure.Vec

	BlockedBy stringset.StringSet
}

Camera represents an observer.

func (*Camera) Name

func (c *Camera) Name() string

type Control

type Control struct {
	Agent Agent
}

func (*Control) Name

func (p *Control) Name() string

type Drawable

type Drawable struct {
	Char    rune
	FgColor color.Color
	BgColor color.Color
}

Drawable represents a drawable.

func (*Drawable) Name

func (d *Drawable) Name() string

Name returns the component's name

type Focus

type Focus struct {
	// Punctual indicates that the camera should focus on this object only once.
	Punctual bool

	// A higher priority means that the camera should prioritize focusing on this entity.
	Priority int
}

func (*Focus) Name

func (f *Focus) Name() string

Name returns this component's name.

type Initiative

type Initiative struct{}

func (*Initiative) Name

func (i *Initiative) Name() string

type Movement

type Movement struct {
	Direction cartography.Direction
}

func (*Movement) Name

func (m *Movement) Name() string

type Physics

type Physics struct {
	BlockedBy stringset.StringSet
}

func (*Physics) Name

func (p *Physics) Name() string

type Player

type Player struct{}

func (*Player) Name

func (p *Player) Name() string

type Position

type Position struct {
	structure.Vec
}

Position represents a X, Y position in the window

func (*Position) Name

func (p *Position) Name() string

Jump to

Keyboard shortcuts

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