commonMain.org.luaj.vm2.NonTableMetatable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of luak Show documentation
Show all versions of luak Show documentation
Multiplatform Kotlin LuaJ port (LUA interpreter)
package org.luaj.vm2
import org.luaj.vm2.LuaTable.Slot
internal class NonTableMetatable(private val value: LuaValue) : Metatable {
override fun useWeakKeys(): Boolean = false
override fun useWeakValues(): Boolean = false
override fun toLuaValue(): LuaValue = value
override fun entry(key: LuaValue, value: LuaValue): Slot = LuaTable.defaultEntry(key, value)
override fun wrap(value: LuaValue): LuaValue = value
override fun arrayget(array: Array, index: Int): LuaValue? = array[index]
}