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

Function GetReciprocalExit

internal/mapper/mapper.go:108–121  ·  view source on GitHub ↗

This is a useful function to help enforce map coherence when building

(exitDirection string)

Source from the content-addressed store, hash-verified

106
107// This is a useful function to help enforce map coherence when building
108func GetReciprocalExit(exitDirection string) string {
109 // first validate the exitName
110 if deltas, ok := posDeltas[exitDirection]; ok {
111
112 // Assign values to search for
113 x, y, z := deltas.x*-1, deltas.y*-1, deltas.z*-1
114 for name, d := range posDeltas {
115 if d.x == x && d.y == y && d.z == z {
116 return name
117 }
118 }
119 }
120 return ""
121}
122
123func GetDelta(exitName string) (x, y, z int) {
124 if delta, ok := posDeltas[exitName]; ok {

Callers 1

BuildFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected