Documentation
¶
Overview ¶
Code generated by gobindlua; DO NOT EDIT.
Code generated by gobindlua; DO NOT EDIT.
Code generated by gobindlua; DO NOT EDIT.
Code generated by gobindlua; DO NOT EDIT.
Example ¶
package main
import (
"log"
"github.com/ChrisTrenkamp/gobindlua"
lua "github.com/yuin/gopher-lua"
)
const script = `
local mammals = mammal_list.new()
mammals.pet = dog.new()
mammals.non_pets = { lion.new(), human.new() }
print("My pet says: " .. mammals.pet:sound())
print("The other mammals say:")
for i=1,#mammals.non_pets,1 do
print(mammals.non_pets[i]:sound())
end
`
func main() {
L := lua.NewState()
defer L.Close()
gobindlua.Register(L, &Dog{}, &Lion{}, &Human{}, &MammalList{})
if err := L.DoString(script); err != nil {
log.Fatal(err)
}
}
Output: My pet says: bark The other mammals say: rawr burp
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mammal ¶
type Mammal interface {
Sound() string
gobindlua.LuaUserData
}
type MammalList ¶
func NewMammalList ¶
func NewMammalList() MammalList
func (*MammalList) LuaMetatableType ¶
func (r *MammalList) LuaMetatableType() string
func (*MammalList) RegisterLuaType ¶
func (goType *MammalList) RegisterLuaType(L *lua.LState)
Click to show internal directories.
Click to hide internal directories.