WIP Direction struct

trunk
nate smith 2023-05-02 20:35:15 -07:00
parent 209833798b
commit 8fd8331a96
2 changed files with 31 additions and 9 deletions

View File

@ -0,0 +1,31 @@
package witch
const (
dirEast = "_DIR_EAST"
dirWest = "_DIR_WEST"
dirNorth = "_DIR_NORTH"
dirSouth = "_DIR_SOUTH"
dirAbove = "_DIR_ABOVE"
dirBelow = "_DIR_BELOW"
)
type Direction struct {
raw string
}
func (d Direction) Reverse() Direction {
// TODO
return Direction{}
}
// NormalizeHuman takes a direction someone might type like "up" or "north" and returns the correct Direction struct
func NormalizeHuman(humanDir string) Direction {
// TODO
return Direction{}
}
// Human returns a string form of this direction like "above" or "north"
func (d Direction) Human() string {
// TODO
return ""
}

View File

@ -16,15 +16,6 @@ import (
lua "github.com/yuin/gopher-lua"
)
const (
dirEast = "_DIR_EAST"
dirWest = "_DIR_WEST"
dirNorth = "_DIR_NORTH"
dirSouth = "_DIR_SOUTH"
dirAbove = "_DIR_ABOVE"
dirBelow = "_DIR_BELOW"
)
/*
allows({
read = "world",