if (amountNeeded <= 0){ Arrays.fill(getActualFlowRates(), 0f); return 0f; }
    public float getResourceFromStores(float amountNeeded) {        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));            float resourceToGatherFinal = Math.min(resourceToGatherFirst,                    getDesiredFlowRate(i));            getActualFlowRates()[i] = getStores()[i]                    .take(resourceToGatherFinal);            gatheredResource += getActualFlowRate(i);        }        return gatheredResource;    }