MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / arrowForDelta

Function arrowForDelta

internal/mapper/mapper.go:981–1003  ·  view source on GitHub ↗

arrowForDelta returns the connector rune that best represents the direction from one room to another given the raw coordinate delta between them.

(dx, dy, dz int)

Source from the content-addressed store, hash-verified

979// arrowForDelta returns the connector rune that best represents the direction
980// from one room to another given the raw coordinate delta between them.
981func arrowForDelta(dx, dy, dz int) rune {
982 if dz != 0 {
983 if dz > 0 {
984 return '^'
985 }
986 return 'v'
987 }
988 switch {
989 case dx == 0 && dy != 0:
990 return '│'
991 case dy == 0 && dx != 0:
992 return '─'
993 case dx > 0 && dy < 0:
994 return '╱'
995 case dx < 0 && dy > 0:
996 return '╱'
997 case dx > 0 && dy > 0:
998 return '╲'
999 case dx < 0 && dy < 0:
1000 return '╲'
1001 }
1002 return '•'
1003}
1004
1005func (r *mapper) getMapNode(roomId int) *mapNode {
1006

Callers 2

TestArrowForDeltaFunction · 0.85
getMapNodeMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestArrowForDeltaFunction · 0.68