protected void tick()
	{
		if(entitiesByDepth==null)
			return;
		for(ArrayList<Entity> entities:entitiesByDepth.values())
			for(Entity entity:entities)
				entity.tick();
		
		for(Pair<Entity,Pair<Integer,Integer>> pair:addEntitiesDepthQueue)
		{
			entitiesByDepth.get(pair.second().first()).remove(pair.first());
			if(!entitiesByDepth.containsKey(pair.second().second()))
				entitiesByDepth.put(pair.second().second(),new ArrayList<Entity>());
			entitiesByDepth.get(pair.second().second()).add(pair.first());
		}
		addEntitiesDepthQueue.clear();
	}