interfaces

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 3 Imported by: 0

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 dog = require "dog"
local lion = require "lion"
local human = require "human"
local mammal_list = require "mammal_list"

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 Dog

type Dog struct{}

func NewDog

func NewDog() Dog

func (*Dog) LuaMetatableType

func (r *Dog) LuaMetatableType() string

func (*Dog) LuaModuleLoader added in v0.0.9

func (goType *Dog) LuaModuleLoader(L *lua.LState) int

func (*Dog) LuaModuleName added in v0.0.9

func (goType *Dog) LuaModuleName() string

func (*Dog) LuaRegisterGlobalMetatable added in v0.0.9

func (goType *Dog) LuaRegisterGlobalMetatable(L *lua.LState)

func (Dog) Sound

func (d Dog) Sound() string

type Human

type Human struct{}

func NewHuman

func NewHuman() Human

func (*Human) LuaMetatableType

func (r *Human) LuaMetatableType() string

func (*Human) LuaModuleLoader added in v0.0.9

func (goType *Human) LuaModuleLoader(L *lua.LState) int

func (*Human) LuaModuleName added in v0.0.9

func (goType *Human) LuaModuleName() string

func (*Human) LuaRegisterGlobalMetatable added in v0.0.9

func (goType *Human) LuaRegisterGlobalMetatable(L *lua.LState)

func (Human) Sound

func (h Human) Sound() string

type Lion

type Lion struct{}

func NewLion

func NewLion() Lion

func (*Lion) LuaMetatableType

func (r *Lion) LuaMetatableType() string

func (*Lion) LuaModuleLoader added in v0.0.9

func (goType *Lion) LuaModuleLoader(L *lua.LState) int

func (*Lion) LuaModuleName added in v0.0.9

func (goType *Lion) LuaModuleName() string

func (*Lion) LuaRegisterGlobalMetatable added in v0.0.9

func (goType *Lion) LuaRegisterGlobalMetatable(L *lua.LState)

func (Lion) Sound

func (c Lion) Sound() string

type Mammal

type Mammal interface {
	Sound() string
	gobindlua.LuaUserData
}

type MammalList

type MammalList struct {
	Pet     Mammal
	NonPets []Mammal
}

func NewMammalList

func NewMammalList() MammalList

func (*MammalList) LuaMetatableType

func (r *MammalList) LuaMetatableType() string

func (*MammalList) LuaModuleLoader added in v0.0.9

func (goType *MammalList) LuaModuleLoader(L *lua.LState) int

func (*MammalList) LuaModuleName added in v0.0.9

func (goType *MammalList) LuaModuleName() string

func (*MammalList) LuaRegisterGlobalMetatable added in v0.0.9

func (goType *MammalList) LuaRegisterGlobalMetatable(L *lua.LState)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL