function PlayerSpots.assignSpot(v,V,n)v:_removeUnusedSpots(V)local S=#v.placedSpots<v.quota local i=not n:isFull()local P=v:_hasArtOnCanvas(n)if i and S then return v:_assignRandomSpot(n)elseif i and not S then v:_removeOldestArt()return v:_assignRandomSpot(n)elseif not i and P then v:_removeOldestArtFromCanvas(n)return v:_assignRandomSpot(n)elseif i and(not S and not P)then v:_removeOldestArtFromOtherCanvas(n)return v:_assignRandomSpot(n)elseif not i and not P then return false,constants.Errors.SpotNotAvailable end end

function PlayerSpots:assignSpot(player, canvas)
	-- Removes previous spot that has no art placed. This happens if player gets a spot but cancels before placing an art
	self:_removeUnusedSpots(player)

	local playerHasQuota = #self.placedSpots < self.quota
	local canvasHasSpot = not canvas:isFull()
	local playerHasArtOnSurface = self:_hasArtOnCanvas(canvas)

	if canvasHasSpot and playerHasQuota then
		return self:_assignRandomSpot(canvas)
	elseif canvasHasSpot and not playerHasQuota then
		self:_removeOldestArt()

		return self:_assignRandomSpot(canvas)
	elseif not canvasHasSpot and playerHasArtOnSurface then
		self:_removeOldestArtFromCanvas(canvas)

		return self:_assignRandomSpot(canvas)
	elseif canvasHasSpot and not playerHasQuota and not playerHasArtOnSurface then
		self:_removeOldestArtFromOtherCanvas(canvas)

		return self:_assignRandomSpot(canvas)
	elseif not canvasHasSpot and not playerHasArtOnSurface then
		return false, constants.Errors.SpotNotAvailable
	end
end
