direction

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbbreviationToString

func AbbreviationToString(abbrev string) (str string, err error)

turn an abbreviation like "n" into a string like "North"

func DirectionToAbbreviation

func DirectionToAbbreviation(dir Direction) (str string, err error)

take a value such as Direction.NORTH and turn it into an abbreviation such as "n" noinspection GoNameStartsWithPackageName

func DirectionToString

func DirectionToString(d Direction) (str string, err error)

noinspection GoNameStartsWithPackageName

func ExitsToFormattedString

func ExitsToFormattedString(exits string) (result string, err error)

Given an 'exits' string like "nsed", return a formatted string for the player with something like "North, South, East, Down"

Types

type Direction

type Direction int32

noinspection GoNameStartsWithPackageName

const (
	NONE  Direction = iota // 0
	NORTH                  // 1
	EAST                   // 2
	SOUTH                  // 3
	WEST                   // 4
	UP                     // 5
	DOWN                   // 6
)

func StringToDirection

func StringToDirection(s string) (dir Direction, err error)

take an abbreviation such as "n" and turn it into a direction int const like Direction.NORTH

Jump to

Keyboard shortcuts

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