mutations

package
v0.0.0-...-2d400ac Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutation

type Mutation interface {
	Apply(objects.Game) objects.Game
}

Mutation functions are applied to a given game state, returning an updated state.

func Debug

func Debug() Mutation

Debug toggles the debug flag on the game.

func Expire

func Expire() Mutation

Expire will iterate over objects, clearing them if they are expired.

func Income

func Income(t time.Time) Mutation

Income increases the funds currently available to the game based on revenue.

func Interact

func Interact() Mutation

Interact mutates the state based on the current mode.

func Intramode

func Intramode() Mutation

Intramode interacts with the current state based on the mode.

func Mode

func Mode() Mutation

Mode toggles the game cursor's current mode.

func Move

func Move(x int, y int) Mutation

Move translates the current game's cursor by the provided x and y amounts.

func Resize

func Resize(width, height int) Mutation

Resize mutations update the game's viewport dimensions.

func Turn

func Turn(amt int) Mutation

Turn is a mutation that will queue up a new turn.

Jump to

Keyboard shortcuts

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