Added lua-language-server annotations
This commit is contained in:
parent
178043bac3
commit
c7d8fa4f8b
7 changed files with 151 additions and 87 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue