Documentation
¶
Index ¶
- Constants
- Variables
- func AddMapper(m *mapper, lookupRoomId int)
- func AdjustExitName(exitName string) (newExitName, newExitDirection string, err error)
- func GetDelta(exitName string) (x, y, z int)
- func GetDirectionDeltaNames() []string
- func GetMapper(roomId int, forceRefresh ...bool) *mapper
- func GetMapperIfExists(roomId int) *mapper
- func GetPath(startRoomId int, endRoomId ...int) ([]pathStep, error)
- func GetReciprocalExit(exitDirection string) string
- func IsCompassDirection(exitName string) bool
- func IsValidDirection(directionName string) bool
- func IsValidExitDirection(exitName string) bool
- func NewMapper(rootRoomId int) *mapper
- func PreCacheMaps()
- type Config
- type RoomGrid
- type SymbolOverride
Constants ¶
View Source
const ( SecretSymbol = '?' LockedSymbol = '⚷' )
Variables ¶
View Source
var ( ErrOutOfBounds = errors.New(`out of bounds`) ErrRoomNotFound = errors.New(`room not found`) )
View Source
var ( ErrPathNotFound = errors.New(`path not found`) ErrPathDestMatch = errors.New(`path destination is same as source`) )
Functions ¶
func AdjustExitName ¶
AdjustExitName splits an exit identifier into a base name and an optional direction. Supported formats:
"east" → ("east", "east", nil) "east-x2" → ("east", "east-x2", nil) "cave" → ("cave", "", nil) "cave:south" → ("cave", "south", nil) "cave:south-x2" → ("cave", "south-x2", nil)
func GetDirectionDeltaNames ¶
func GetDirectionDeltaNames() []string
func GetMapperIfExists ¶
func GetMapperIfExists(roomId int) *mapper
Returns the mapper if it exists, otherwise does nothing.
func GetReciprocalExit ¶
This is a useful function to help enforce map coherence when building
func IsCompassDirection ¶
Returns true if exitName is a compass direction (north, south, east, west, northwest)
func IsValidDirection ¶
func IsValidExitDirection ¶
Returns true if exitName resolves to any position delta
func PreCacheMaps ¶
func PreCacheMaps()
Types ¶
type Config ¶
type SymbolOverride ¶
Click to show internal directories.
Click to hide internal directories.