public bool Take(PowerPlantMaterialStore.Type type, int count) { if (inventory [(int)type] < count) { return(false); } inventory [(int)type] -= count; return(true); }
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; } }
public int QueryCost(PowerPlantMaterialStore.Type type) { return(costTable[(int)type, QueryInventory(type)]); }
public int QueryInventory(PowerPlantMaterialStore.Type type) { return(inventory [(int)type]); }