if (amountNeeded <= 0){ Arrays.fill(getActualFlowRates(), 0f); return 0f; }
    public float getFractionalResourceFromStores(float amountNeeded,            float fraction) {        if (getStores() == null)            return 0f;        float gatheredResource = 0f;        for (int i = 0; (i < getStores().length)                && (gatheredResource < amountNeeded); i++) {            float resourceToGatherFirst = Math.min(amountNeeded,                    getMaxFlowRate(i) * fraction);            float resourceToGatherFinal = Math.min(resourceToGatherFirst,                    getDesiredFlowRate(i) * fraction);            float grabbed = getStores()[i].take(resourceToGatherFinal);            getActualFlowRates()[i] += grabbed;            gatheredResource += grabbed;        }        return gatheredResource;    }