/**
 *  Allocate resources to the top item on this production queue
 *  and return the leftover resources
 */
    private Cost allocateToQueue(ProductionQueue queue, Cost costPer, Cost allocated)
    {
        double ironiumPerc   = (costPer.getIronium() > 0 ? (double)(allocated.getIronium()) / costPer.getIronium() : 100.0);
        double boraniumPerc  = (costPer.getBoranium() > 0 ? (double)(allocated.getBoranium()) / costPer.getBoranium() : 100.0);
        double germaniumPerc = (costPer.getGermanium() > 0 ? (double)(allocated.getGermanium()) / costPer.getGermanium() : 100.0);
        double resourcesPerc = (costPer.getResources() > 0 ? (double)(allocated.getResources()) / costPer.getResources() : 100.0);

        double minPerc = Mathf.Min((float)ironiumPerc, Mathf.Min((float)boraniumPerc, Mathf.Min((float)germaniumPerc, (float)resourcesPerc)));

        queue.setAllocated(new Cost((int)(costPer.getIronium() * minPerc), (int)(costPer.getBoranium() * minPerc), (int)(costPer.getGermanium() * minPerc),
                                    (int)(costPer.getResources() * minPerc)));
        return(allocated.subtract(queue.getAllocated()));
    }