Esempio n. 1
0
    public bool MinusId(int id, int count = 1)
    {
        InventoryItemGrid grid = null;

        foreach (InventoryItemGrid temp in itemGridList)
        {
            if (temp.id == id)
            {
                grid = temp; break;
            }
        }
        if (grid == null)
        {
            return(false);
        }
        else
        {
            bool isSuccess = grid.MinusNumber(count);
            return(isSuccess);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 减去物品
    /// </summary>
    public bool MinusItem(string id, int count = 1)
    {
        InventoryItemGrid grid = CheckItemNum(id);

        return(grid == null ? false : grid.MinusNumber(count));
    }