]> git.lizzy.rs Git - mt.git/blob - nodebox.go
Add WaitGroup to SerializePkt
[mt.git] / nodebox.go
1 package mt
2
3 type Box [2]Vec
4
5 type NodeBoxType uint8
6
7 const (
8         CubeBox      NodeBoxType = iota // Cube
9         FixedBox                        // Fixed
10         MountedBox                      // Mounted
11         LeveledBox                      // Leveled
12         ConnectedBox                    // Connected
13         maxBox
14 )
15
16 //go:generate stringer -linecomment -type NodeBoxType
17
18 type DirBoxes struct {
19         Top, Bot                 []Box
20         Front, Left, Back, Right []Box
21 }
22
23 type NodeBox struct {
24         //mt:const uint8(6)
25
26         Type NodeBoxType
27         //mt:assert %s.Type < maxBox
28
29         //mt:if %s.Type == MountedBox
30         WallTop, WallBot, WallSides Box
31         //mt:end
32
33         //mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox
34         Fixed []Box
35         //mt:end
36
37         //mt:if %s.Type == ConnectedBox
38         ConnDirs, DiscoDirs  DirBoxes
39         DiscoAll, DiscoSides []Box
40         //mt:end
41 }