示例#1
0
    // this function checks the shipping dock to see if orders can be fulfilled
    // lets play you have to have the order items in the shipping dock to fulfill it
    // returns true if order is fulfilled, false if order isn't
    public bool StageOrder(Order o)
    {
        Dictionary <string, int> order = o.order;

        // sorry this is gross, prob a better way to do this
        foreach (KeyValuePair <string, int> item in order)
        {
            if (!_supply.AvailableItem(item.Key, item.Value))
            {
                return(false);
            }
        }
        foreach (KeyValuePair <string, int> item in order)
        {
            _supply.AddStaged(item.Key, item.Value);
        }
        _panels.UpdateProjected();
        return(true);
    }