This is a useful function to help enforce map coherence when building
(exitDirection string)
| 106 | |
| 107 | // This is a useful function to help enforce map coherence when building |
| 108 | func 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 | |
| 123 | func GetDelta(exitName string) (x, y, z int) { |
| 124 | if delta, ok := posDeltas[exitName]; ok { |