summaryrefslogtreecommitdiff
path: root/types.go
blob: 5c923a391a30164867104b8215ba40b7d54745b4 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
package mtmap

import (
	"fmt"
	"github.com/anon55555/mt"
)

type MapBlk struct {
	mt.MapBlk
	Flags            MapBlkFlags
	LightingComplete uint16
	StaticObjs       []StaticObj
	Timestamp        uint32
}

type MapBlkFlags uint8

const (
	IsUnderground MapBlkFlags = 1 << iota
	DayNightDiffers
	NotGenerated = 1 << 4
)

var (
	SerializeVer uint8 = 28
	ContentWidth uint8 = 2
	ParamsWidth  uint8 = 2
	NodeMetaVer  uint8 = 2
	StaticObjVer uint8 = 0
	NameIdMapVer uint8 = 0
)

type StaticObj struct {
	Type uint8
	Pos  [3]float32
	Data string
}

type ErrInvalidNodeName struct {
	Name string
}

func (e ErrInvalidNodeName) Error() string {
	return fmt.Sprintf("invalid node \"%v\"", e.Name)
}

type ErrInvalidNodeId struct {
	Id mt.Content
}

func (e ErrInvalidNodeId) Error() string {
	return fmt.Sprintf("invalid node %v", e.Id)
}