blob: 653777a38ad4a3da30e58c15d3cb75fdc0b7e7e5 [file] [log] [blame] [raw]
package li.cil.oc.util
import com.naef.jnlua.{JavaFunction, LuaState}
import scala.language.implicitConversions
object ExtendedLuaState {
implicit def extendLuaState(state: LuaState) = new ExtendedLuaState(state)
class ExtendedLuaState(val state: LuaState) {
def pushScalaFunction(f: (LuaState) => Int) = state.pushJavaFunction(new JavaFunction {
override def invoke(state: LuaState) = f(state)
})
}
}