]> git.lizzy.rs Git - mt.git/blob - dir.go
Add WaitGroup to SerializePkt
[mt.git] / dir.go
1 package mt
2
3 // A Dir represents a direction parallel to an axis.
4 type Dir uint8
5
6 const (
7         East  Dir = iota // +X
8         Above            // +Y
9         North            // +Z
10         South            // -Z
11         Below            // -Y
12         West             // -X
13         NoDir
14 )
15
16 //go:generate stringer -type Dir
17
18 // Opposite returns the Dir's opposite.
19 // NoDir is its own opposite.
20 func (d Dir) Opposite() Dir {
21         if d >= NoDir {
22                 return NoDir
23         }
24         return 5 - d
25 }