mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
f32d8588e0
Together, these classes provide a way to represent a mesh of faces generated from the Minetest world. This way, the generation of a mesh can be abstracted away from any potential output file writers, thereby allowing for multiple different output file formats to be supported.
19 lines
477 B
Lua
19 lines
477 B
Lua
|
|
--- Looks to see whether a given table contains a given value.
|
|
-- @param tbl table The table to look in.
|
|
-- @param target any The target to look for.
|
|
-- @returns bool Whether the table contains the given target or not.
|
|
local function table_contains(tbl, target)
|
|
for key, value in ipairs(tbl) do
|
|
if value == target then return true end
|
|
end
|
|
return false
|
|
end
|
|
|
|
|
|
if worldeditadditions then
|
|
worldeditadditions.table_contains = table_contains
|
|
else
|
|
return table_contains
|
|
end
|