From b0701632e610c4bb7f7e262f946a4ffafdbc9f29 Mon Sep 17 00:00:00 2001 From: Alexey Date: Sun, 5 Oct 2025 19:10:45 +0300 Subject: [PATCH] add common function to Unit layer --- com/Unit/_common.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 com/Unit/_common.lua diff --git a/com/Unit/_common.lua b/com/Unit/_common.lua new file mode 100644 index 0000000..a4ee809 --- /dev/null +++ b/com/Unit/_common.lua @@ -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 \ No newline at end of file