diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 76e5218..c3243f2 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -55,5 +55,8 @@ jobs: - name: Install luacheck run: luarocks install luacheck - - name: Run Lua Check - run: luacheck ./src --config .luacheckrc \ No newline at end of file + # - name: Run Lua Check + # run: luacheck ./src --config .luacheckrc + + - name: Check Types + uses: mrcjkb/lua-typecheck-action@08d5ead5db7b1c8457aa7a0e566240b680b34588 \ No newline at end of file diff --git a/src/classes/util/Util.lua b/src/classes/util/Util.lua index 09c8465..697e7b6 100644 --- a/src/classes/util/Util.lua +++ b/src/classes/util/Util.lua @@ -237,8 +237,13 @@ do -- INIT UTIL return ((vec1Norm.x * vec2Norm.x) + (vec1Norm.y * vec2Norm.y) + (vec1Norm.z * vec2Norm.z)) end - + + ---@param polygon Array of pairs { x, y } + ---@param x number X location + ---@param y number Y location + ---@return boolean local function isInComplexPolygon(polygon, x, y) + ---@param poly Array of pairs { x, y } local function getEdges(poly) local result = {} for i = 1, #poly do @@ -399,7 +404,9 @@ do -- INIT UTIL if #points == 0 then return {} end -- Simple clustering: group points that are within minSeparation of each other + ---@type Array> local clusters = {} + ---@type table local assigned = {} for i, p in ipairs(points) do