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