private static int removeFromArray(int count, AreaObject[] array, AreaObject obj) {
		for (int i = 0; i < count; i++) {
			if (array[i] == obj) {
				if (i != --count) {
					array[i] = array[count];
				}
				array[count] = null;
				break;
			}
		}
		return count;
	}