mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-03 08:52:24 +00:00
add common function to Unit layer
This commit is contained in:
23
com/Unit/_common.lua
Normal file
23
com/Unit/_common.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
-- File com/Unit/_common.lua
|
||||||
|
--
|
||||||
|
-- Created at 2025-05-10 18:23
|
||||||
|
--
|
||||||
|
-- Updated at -
|
||||||
|
-- Description:
|
||||||
|
--- Common functions for Unit module
|
||||||
|
|
||||||
|
local common = {}
|
||||||
|
|
||||||
|
function common.CheckMissingElement(arr, cmp)
|
||||||
|
local is_missing = {}
|
||||||
|
local ok = true
|
||||||
|
for _, key in ipairs(arr) do
|
||||||
|
if cmp[key] == nil then
|
||||||
|
table.insert(is_missing, key)
|
||||||
|
ok = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ok, is_missing
|
||||||
|
end
|
||||||
|
|
||||||
|
return common
|
||||||
Reference in New Issue
Block a user