Makeclass cleaned up

This commit is contained in:
2021-02-10 16:22:24 -05:00
parent e838b4ac97
commit 3883f86dee
13 changed files with 120 additions and 54 deletions

View File

@@ -426,7 +426,7 @@ public:
void newtable(LuaSlot target) const;
void makeclass(LuaSlot tab, LuaSlot name) const;
void makesubtable(LuaSlot sub, LuaSlot tab, const char *name) const;
void setlightuserdata(LuaSlot target, void *p) const;
@@ -456,11 +456,26 @@ public:
void clearuserdata(LuaSlot target) { clear_tagged_pointer(target); }
int next(LuaSlot tab, LuaSlot key, LuaSlot value) const;
bool isemptytable(LuaSlot s) const;
bool equal(LuaSlot v1, LuaSlot v2) {
void makeclass(LuaSlot tab, LuaSlot name) const;
void makeclass(LuaSlot tab, const char *name) const {
push_any_value(name);
LuaSpecial classname(lua_gettop(L_));
makeclass(tab, classname);
lua_pop(L_, 1);
}
bool equal(LuaSlot v1, LuaSlot v2) const {
return lua_equal(L_, v1, v2);
}
bool equal(LuaSlot v1, const char *name) const {
push_any_value(name);
bool result = lua_equal(L_, v1, -1);
lua_pop(L_, 1);
return result;
}
template<typename T1, typename T2>
void set(T1 &target, T2 value) const {