All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.luaj.vm2.NonTableMetatable.kt Maven / Gradle / Ivy

Go to download

LUAK - Kotlin port of LuaJ (fork of https://github.com/korlibs/korge-luak)

There is a newer version: 1.0.0-alpha3
Show newest version
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]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy