]> git.lizzy.rs Git - mtmap.git/commitdiff
Add Peek- and PokeNode functions to MapBlk (#1)
authorRiley <49880817+DerZombiiie@users.noreply.github.com>
Sat, 16 Jul 2022 23:13:57 +0000 (01:13 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Jul 2022 23:13:57 +0000 (01:13 +0200)
* added PickNode to MapBlk

* renamed MapBlk.PickNode to MapBlk.PeekNode

* added funktion MapBlk.PokeNode as reverse of MapBlk.PeekNode

tools.go [new file with mode: 0644]

diff --git a/tools.go b/tools.go
new file mode 100644 (file)
index 0000000..8e4f35a
--- /dev/null
+++ b/tools.go
@@ -0,0 +1,19 @@
+package mtmap
+
+import (
+       "github.com/anon55555/mt"
+)
+
+func (mb *MapBlk) PeekNode(i int) mt.Node {
+       return mt.Node{
+               Param0: mb.Param0[i],
+               Param1: mb.Param1[i],
+               Param2: mb.Param2[i],
+       }
+}
+
+func (mb *MapBlk) PokeNode(i int, node mt.Node) {
+       mb.Param0[i] = node.Param0
+       mb.Param1[i] = node.Param1
+       mb.Param2[i] = node.Param2
+}