예제 #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]);
 }