Expose objects array to lua

This commit is contained in:
Pasi Kallinen
2019-12-12 13:39:20 +02:00
parent 027024d27f
commit 1d9ba3e212
3 changed files with 110 additions and 4 deletions

View File

@@ -39,3 +39,28 @@ local o4tbl = o4:totable();
if (o4tbl.otyp_name ~= "rock") then
error("no rock under the large box");
end
local oc = obj.class(o4tbl.otyp);
if (oc.name ~= "rock") then
error("object class is not rock, part 1");
end
if (oc.class ~= "*") then
error("object class is not *, part 1");
end
local oc2 = obj.class(o);
if (oc2.name ~= "rock") then
error("object class is not rock, part 2");
end
if (oc2.class ~= "*") then
error("object class is not *, part 2");
end
local oc3 = obj.class(obj.new("rock"));
if (oc3.name ~= "rock") then
error("object class is not rock, part 3");
end
if (oc3.class ~= "*") then
error("object class is not *, part 3");
end