summaryrefslogtreecommitdiff
path: root/itemdef.go
diff options
context:
space:
mode:
authoranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
committeranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
commit425da65ed46061303604610bb539d6495b2b1f3f (patch)
tree10ae3e665132c369ce0207676321cef870679923 /itemdef.go
parent9f239d341ef46b656dda759020da87bdd0606344 (diff)
Add high-level protocol (de)serialization
Diffstat (limited to 'itemdef.go')
-rw-r--r--itemdef.go56
1 files changed, 56 insertions, 0 deletions
diff --git a/itemdef.go b/itemdef.go
new file mode 100644
index 0000000..a761b65
--- /dev/null
+++ b/itemdef.go
@@ -0,0 +1,56 @@
+package mt
+
+import "image/color"
+
+type ItemType uint8
+
+const (
+ _ ItemType = iota
+ NodeItem
+ CraftItem
+ ToolItem
+)
+
+// An ItemDef defines the properties of an item.
+type ItemDef struct {
+ //mt:lenhdr 16
+
+ // Version.
+ //mt:const uint8(6)
+
+ Type ItemType
+
+ Name, Desc string
+
+ InvImg, WieldImg Texture
+ WieldScale [3]float32
+
+ StackMax uint16
+
+ Usable bool
+ CanPointLiquids bool
+
+ ToolCaps ToolCaps
+
+ Groups []Group
+
+ PlacePredict string
+
+ PlaceSnd, PlaceFailSnd SoundDef
+
+ PointRange float32
+
+ // Set index in Palette with "palette_index" item meta field,
+ // this overrides Color.
+ Palette Texture
+ Color color.NRGBA
+
+ // Texture overlays.
+ InvOverlay, WieldOverlay Texture
+
+ ShortDesc string
+
+ PlaceParam2 byte
+
+ //mt:end
+}