order

package
v0.0.0-...-11e9a73 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ACTIONS = map[byte]func(partialAction *Action){
	'.': IdleAction,
	'm': MoveAction,
	'p': PushAction,
	'*': PunchAction,
	'l': LeapAction,
}

Map of the base command string 'verbs' to which functions handle them

Functions

func IdleAction

func IdleAction(me *Action)

Makes you do nothing for one turn

func LeapAction

func LeapAction(me *Action)

Leaps in a direction, over other entities

func MoveAction

func MoveAction(me *Action)

Moves your entity over one

func NewAction

func NewAction(at string) interfaces.Action

Smartly creates a new action based on the given action string

func NewOrder

func NewOrder(commandcode, ticknum int, actions []string,
	player interfaces.Player, game interfaces.Game) *order

func PunchAction

func PunchAction(me *Action)

Punches a neighbouring entity

func PushAction

func PushAction(me *Action)

Pushes a neighbouring entity over one

Types

type Action

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

func (*Action) Act

Wrapper around the act member to work with interfaces

func (*Action) ActionString

func (a *Action) ActionString() string

func (*Action) AvailableDirections

func (a *Action) AvailableDirections() [5]bool

func (*Action) LongDescription

func (a *Action) LongDescription() string

func (*Action) ShortDescription

func (a *Action) ShortDescription() string

Jump to

Keyboard shortcuts

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