--[[
	Finds an empty canvas spot and returns it.

	Returns:
	- isSuccess (boolean): true if spot can be found, false if the canvas is full
]]

function Canvas:getEmptySpot()
	if self:isFull() then
		return false, constants.Errors.CanvasFull
	end

	local emptySpots = {}
	for _, spot in ipairs(self.spots) do
		if not spot:hasArt() then
			table.insert(emptySpots, spot)
		end
	end

	local spotIndex = self.rng:NextInteger(1, #emptySpots)

	return true, emptySpots[spotIndex]
end
