util

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

This section is empty.

Functions

func Distance

func Distance(fromX, fromY, toX, toY int) int

Returns the rounded integer distance between two points

func PrimaryDirection

func PrimaryDirection(fromX, fromY, toX, toY int) interfaces.Direction

Returns the primary direction of travel of a vector

Types

type Direction

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

func NewDirection

func NewDirection(code byte) *Direction

func (*Direction) Code

func (me *Direction) Code() byte

func (*Direction) Name

func (me *Direction) Name() string

func (*Direction) Opposite

func (me *Direction) Opposite() interfaces.Direction

func (*Direction) XYDelta

func (me *Direction) XYDelta() (int, int)

Jump to

Keyboard shortcuts

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