summaryrefslogtreecommitdiff
path: root/nodebox.go
blob: ce144a408239aa713561dfb40dada12e4fab7b20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package mt

type Box [2]Vec

type NodeBoxType uint8

const (
	CubeBox      NodeBoxType = iota // Cube
	FixedBox                        // Fixed
	MountedBox                      // Mounted
	LeveledBox                      // Leveled
	ConnectedBox                    // Connected
	maxBox
)

//go:generate stringer -linecomment -type NodeBoxType

type DirBoxes struct {
	Top, Bot                 []Box
	Front, Left, Back, Right []Box
}

type NodeBox struct {
	//mt:const uint8(6)

	Type NodeBoxType
	//mt:assert %s.Type < maxBox

	//mt:if %s.Type == MountedBox
	WallTop, WallBot, WallSides Box
	//mt:end

	//mt:if t := %s.Type; t == FixedBox || t == LeveledBox || t == ConnectedBox
	Fixed []Box
	//mt:end

	//mt:if %s.Type == ConnectedBox
	ConnDirs, DiscoDirs  DirBoxes
	DiscoAll, DiscoSides []Box
	//mt:end
}