コード例 #1
0
    public int Get(Utils.InventoryObjectType objectType)
    {
        switch (objectType)
        {
        case Utils.InventoryObjectType.Water:
        {
            return(inventory[Utils.waterInventoryIndex]);
        }

        case Utils.InventoryObjectType.Food:
        {
            return(inventory[Utils.foodInventoryIndex]);
        }

        case Utils.InventoryObjectType.Wood:
        {
            return(inventory[Utils.woodInventoryIndex]);
        }

        case Utils.InventoryObjectType.Nails:
        {
            return(inventory[Utils.nailsInventoryIndex]);
        }

        default:
            return(0);
        }
    }
コード例 #2
0
    public void Add(Utils.InventoryObjectType objectType)
    {
        Debug.Log("Adding " + objectType);
        switch (objectType)
        {
        case Utils.InventoryObjectType.Water:
        {
            AddWater();
            break;
        }

        case Utils.InventoryObjectType.Food:
        {
            AddFood();
            break;
        }

        case Utils.InventoryObjectType.Wood:
        {
            AddWood();
            break;
        }

        case Utils.InventoryObjectType.Nails:
        {
            AddNails();
            break;
        }

        default:
            break;
        }
    }
コード例 #3
0
 public void Remove(Utils.InventoryObjectType objectType)
 {
     GenericRemoval((int)objectType);
 }