]> git.lizzy.rs Git - hydra-dragonfire.git/blobdiff - convert/read_static.go
Add map component
[hydra-dragonfire.git] / convert / read_static.go
index 3e7dc3009eaa8c1dfea1da7f59be7ebe78fabd5a..3be41e1068ba911ca4f61acef3ea6a730fd4eaf6 100644 (file)
@@ -7,28 +7,28 @@ import (
 
 //go:generate ./read_mkauto.lua
 
-func readBool(l *lua.LState, val lua.LValue, ptr *bool) {
+func ReadBool(l *lua.LState, val lua.LValue, ptr *bool) {
        if val.Type() != lua.LTBool {
                panic("invalid value for bool: must be a boolean")
        }
        *ptr = bool(val.(lua.LBool))
 }
 
-func readString(l *lua.LState, val lua.LValue, ptr *string) {
+func ReadString(l *lua.LState, val lua.LValue, ptr *string) {
        if val.Type() != lua.LTString {
                panic("invalid value for string: must be a string")
        }
        *ptr = string(val.(lua.LString))
 }
 
-func readSliceByte(l *lua.LState, val lua.LValue, ptr *[]byte) {
+func ReadSliceByte(l *lua.LState, val lua.LValue, ptr *[]byte) {
        if val.Type() != lua.LTString {
                panic("invalid value for []byte: must be a string")
        }
        *ptr = []byte(val.(lua.LString))
 }
 
-func readSliceField(l *lua.LState, val lua.LValue, ptr *[]mt.Field) {
+func ReadSliceField(l *lua.LState, val lua.LValue, ptr *[]mt.Field) {
        if val.Type() != lua.LTTable {
                panic("invalid value for []Field: must be a table")
        }
@@ -40,7 +40,7 @@ func readSliceField(l *lua.LState, val lua.LValue, ptr *[]mt.Field) {
        })
 }
 
-func readPointedThing(l *lua.LState, val lua.LValue, ptr *mt.PointedThing) {
+func ReadPointedThing(l *lua.LState, val lua.LValue, ptr *mt.PointedThing) {
        if val.Type() != lua.LTTable {
                panic("invalid value for PointedThing: must be a table")
        }
@@ -48,12 +48,12 @@ func readPointedThing(l *lua.LState, val lua.LValue, ptr *mt.PointedThing) {
 
        if id != lua.LNil {
                pt := &mt.PointedAO{}
-               readAOID(l, id, &(*pt).ID)
+               ReadAOID(l, id, &(*pt).ID)
                *ptr = pt
        } else {
                pt := &mt.PointedNode{}
-               readVec3Int16(l, l.GetField(val, "under"), &(*pt).Under)
-               readVec3Int16(l, l.GetField(val, "above"), &(*pt).Above)
+               ReadVec3Int16(l, l.GetField(val, "under"), &(*pt).Under)
+               ReadVec3Int16(l, l.GetField(val, "above"), &(*pt).Above)
                *ptr = pt
        }
 }