mapper

package
v0.0.5-test Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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 AddMapper

func AddMapper(m *mapper, lookupRoomId int)

func GetDelta

func GetDelta(exitName string) (x, y, z int)

func GetDirectionDeltaNames

func GetDirectionDeltaNames() []string

func GetMapper

func GetMapper(roomId int, forceRefresh ...bool) *mapper

Get the mapper if it exists, otherwises generates a new map from the roomId

func GetMapperIfExists

func GetMapperIfExists(roomId int) *mapper

Returns the mapper if it exists, otherwise does nothing.

func GetPath

func GetPath(startRoomId int, endRoomId ...int) ([]pathStep, error)

func IsCompassDirection

func IsCompassDirection(exitName string) bool

func IsValidDirection

func IsValidDirection(directionName string) bool

func NewMapper

func NewMapper(rootRoomId int) *mapper

func PreCacheMaps

func PreCacheMaps()

Types

type Config

type Config struct {
	ZoomLevel int // How much to zoom the map? At zero, connections are not shown.
	Width     int // Width of final map render
	Height    int // Height of final map render
	UserId    int // Optional userId to intelligently render some data
	// contains filtered or unexported fields
}

func (*Config) OverrideSymbol

func (c *Config) OverrideSymbol(roomId int, symbol rune, legend string)

type RoomGrid

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

type SymbolOverride

type SymbolOverride struct {
	Symbol rune
	Legend string
}

Jump to

Keyboard shortcuts

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