コード例 #1
0
    public bool Take(PowerPlantMaterialStore.Type type, int count)
    {
        if (inventory [(int)type] < count)
        {
            return(false);
        }

        inventory [(int)type] -= count;
        return(true);
    }
コード例 #2
0
    public void Stock(PowerPlantMaterialStore.Type type, int count)
    {
        //should take into account unit owned by players?

        inventory[(int)type] += count;
        if (inventory [(int)type] > inventoryMaximums [(int)type])
        {
            inventory [(int)type] = inventoryMaximums [(int)type];
        }
        if (inventory [(int)type] < 0)
        {
            inventory [(int)type] = 0;
        }
    }
コード例 #3
0
 public int QueryCost(PowerPlantMaterialStore.Type type)
 {
     return(costTable[(int)type, QueryInventory(type)]);
 }
コード例 #4
0
 public int QueryInventory(PowerPlantMaterialStore.Type type)
 {
     return(inventory [(int)type]);
 }