local ____lualib = require("lualib_bundle")
local __TS__Class = ____lualib.__TS__Class
local ____exports = {}
____exports.GameGrid = __TS__Class()
local GameGrid = ____exports.GameGrid
GameGrid.name = "GameGrid"
function GameGrid.prototype.____constructor(self, size)
    self.round = function(____, coordinate)
        local qGrid = math.floor(coordinate.q + 0.5)
        local rGrid = math.floor(coordinate.r + 0.5)
        coordinate.q = coordinate.q - qGrid
        coordinate.r = coordinate.r - rGrid
        if math.abs(coordinate.q) >= math.abs(coordinate.r) then
            return {
                q = qGrid + math.floor(coordinate.q + 0.5 * coordinate.r + 0.5),
                r = rGrid
            }
        end
        return {
            q = qGrid,
            r = rGrid + math.floor(coordinate.q + 0.5 * coordinate.r + 0.5)
        }
    end
    self.size = size
end
return ____exports
