Added lua-language-server annotations

This commit is contained in:
Alexey 2025-06-25 13:05:41 +03:00
commit c7d8fa4f8b
7 changed files with 151 additions and 87 deletions

View file

@ -2,17 +2,20 @@ require "point"
require "config"
-- Point table with grid-based coordinates
GridPoint = Point:new()
---@class GridPoint: Point
GridPoint = Point
-- Convert grid x, y to global x, y
---@return Point
function GridPoint:absolute()
return Point:new(
return Point:new(
self.x * Config.cellSize,
self.y * Config.cellSize
)
end
-- Same as coords, but converted to global coords
---@return number, number
function GridPoint:globalCoords()
return self.x * Config.cellSize - Config.cellSize / 2, self.y * Config.cellSize - Config.cellSize / 2
end