function MonsterManager.createInterestWhileTrue(k,w,u)local R={position=k,weight=w}table.insert(interests,R);(coroutine.wrap(function()while u()do wait()end interests=TableUtils.without(interests,R)MonsterManager.updateMonsterInterests()end))()MonsterManager.updateMonsterInterests()end
--[[
	Creates a point of interest at specified position, with specified weight. Will continue to exist until the callback function returns false
]]
function MonsterManager.createInterestWhileTrue(position, weight, callback)
	local entry = { position = position, weight = weight }

	table.insert(interests, entry)

	coroutine.wrap(function()
		while callback() do
			wait()
		end
		interests = TableUtils.without(interests, entry)

		MonsterManager.updateMonsterInterests()
	end)()

	MonsterManager.updateMonsterInterests()
end
