public bool CanSell(T type, TradingInventoryAdapter <T> selfInventory, TradingInventoryAdapter <T> marketInventory) { return(selfInventory.Get(type) > 0 && marketInventory.Get(moneyType) > 0 && marketInventory.CanFitMoreOf(type)); }
public float GetTotalUtility(T type, TradingInventoryAdapter <T> inventory) { return(utilityFunctions[type].GetNetValue(inventory.Get(type))); }
private bool CanExchangeInto(T type, TradingInventoryAdapter <T> targetInventory, TradingInventoryAdapter <T> sourceInventory) { return(sourceInventory.Get(type) > 0 && targetInventory.Get(moneyType) > 0 && targetInventory.CanFitMoreOf(type)); }
public float GetIncrementalUtility(T type, TradingInventoryAdapter <T> selfInventory, float increment) { return(utilityFunctions[type].GetIncrementalValue(selfInventory.Get(type), increment)); }