Ejemplo n.º 1
0
    public void Add(FurnitureStack stack)
    {
        FurnitureStack existing = FindStackMatching(stack);

        if (existing != null)
        {
            existing.IncrementCount(stack.Count);
        }
        else
        {
            furnitureStacks.Add(stack);
        }
    }
Ejemplo n.º 2
0
    public void SubtractOne(uint fid)
    {
        FurnitureStack existing = FindStackMatching(fid);

        if (existing != null)
        {
            existing.IncrementCount(-1);
            if (existing.Count <= 0)
            {
                RemoveStacksWithID(existing.FurnitureID);
            }
        }
        else
        {
            Debug.LogError("Trying to subtract from a stack that doesn't exist!");
        }
    }