protected int indexToInsert(GameComponent<?> component) {
		int lowerIndex = 0;
		int higherIndex = this.getComponentCount() - 1;
		int searchedZ = component.getZ();

		if(this.getComponents().isEmpty() || searchedZ < this.getZFromComponentAt(lowerIndex)) {
			return 0;
		}

		if(searchedZ >= this.getZFromComponentAt(higherIndex)) {
			return this.getComponentCount();
		}

		while(lowerIndex <= higherIndex) {
			int middleIndex = lowerIndex + higherIndex >>> 1;
			int middleZ = this.getZFromComponentAt(middleIndex);

			if(middleZ <= searchedZ) {
				lowerIndex = middleIndex + 1;
			}
			else if(middleZ > searchedZ) {
				higherIndex = middleIndex - 1;
			}
		}

		return lowerIndex;
	}