local utils = require "lib.utils.utils"

--- @class Grid
--- @field __grid {string: any}
local grid = {}
grid.__index = grid

--- adds a value to the grid
--- @param value any
function grid:add(value)
    self.__grid[tostring(value.position)] = value
end

--- @param position Vec3
function grid:get(position)
    return self.__grid[tostring(position)]
end

--- clears the grid
function grid:reset()
    self.__grid = {}
end

--- Generates an empty grid
--- @return Grid
function grid.new()
    return setmetatable({
        __grid = {}
    }, grid)
end

return grid
