From e7bfa8b8c451e1f4038447bd6eb160d8586ede61 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 16 Jul 2022 17:53:42 +0200 Subject: Add serialization --- types.go | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 types.go (limited to 'types.go') diff --git a/types.go b/types.go new file mode 100644 index 0000000..abb02e2 --- /dev/null +++ b/types.go @@ -0,0 +1,36 @@ +package mtmap + +import ( + "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 +} -- cgit v1.2.3