public class ComputablePriceV2 extends Object
| Modifier and Type | Field and Description |
|---|---|
private IPriceCalculationV2 |
calculation |
| Constructor and Description |
|---|
ComputablePriceV2() |
| Modifier and Type | Method and Description |
|---|---|
int |
buyPrice(ITradable tradable,
javafx.beans.property.ReadOnlyIntegerProperty availableAmount,
javafx.beans.binding.IntegerBinding amountToBuy)
Integer binding calculation for the buy price.
|
private int |
calculateBuyAmount(ITradable tradable,
int availableAmount,
int maxPrice,
int bottom,
int top,
int firstItemPrice,
long maxCash)
Calculate the maximum amount that is afordable by recustion.
|
int |
calculateBuyAmount(ITradable tradable,
int availableAmount,
int maxPrice,
int maxAmount,
long maxCash)
Calculate the amount between 0 and
maxAmount that can be bought for at max maxPrice |
int |
calculateSellAmount(ITradable tradable,
int availableAmount,
int minPrice,
int maxSellAmount) |
private int |
calculateSellAmount(ITradable tradable,
int availableAmount,
int minPrice,
int bottom,
int top) |
private int |
calculateSellAmountInHalf(ITradable tradable,
int availableAmount,
int minPrice,
int maxSellAmount,
int sellPriceHalfAmount,
int halfAmount,
int bottom) |
(package private) int |
internalBuyPriceCalculation(ITradable tradable,
int availableAmount,
int amountToBuy)
Internal method to calculate the buy price.
|
(package private) int |
internalSellPriceCalculation(ITradable tradable,
int availableAmount,
int amountToSell)
Internal calculation of the sell price.
|
int |
sellPrice(ITradable tradable,
javafx.beans.property.ReadOnlyIntegerProperty availableAmount,
javafx.beans.binding.IntegerBinding amountToSell)
Integer binding calculation of the sell price.
|
private final IPriceCalculationV2 calculation
public int calculateSellAmount(ITradable tradable, int availableAmount, int minPrice, int maxSellAmount)
private int calculateSellAmountInHalf(ITradable tradable, int availableAmount, int minPrice, int maxSellAmount, int sellPriceHalfAmount, int halfAmount, int bottom)
private int calculateSellAmount(ITradable tradable, int availableAmount, int minPrice, int bottom, int top)
int internalSellPriceCalculation(ITradable tradable, int availableAmount, int amountToSell)
tradable - good that is tradedavailableAmount - amount of the good that is in storeamountToSell - amount to be soldint internalBuyPriceCalculation(ITradable tradable, int availableAmount, int amountToBuy)
tradable - good that is to be tradedavailableAmount - amount of the good that is in storeamountToBuy - amount to be boughtpublic int buyPrice(ITradable tradable, javafx.beans.property.ReadOnlyIntegerProperty availableAmount, javafx.beans.binding.IntegerBinding amountToBuy)
tradable - good that is to be tradedavailableAmount - amount of the good that is in storeamountToBuy - amount to be boughtpublic int calculateBuyAmount(ITradable tradable, int availableAmount, int maxPrice, int maxAmount, long maxCash)
maxAmount that can be bought for at max maxPricetradable - that should be boughtavailableAmount - amount that is availablemaxPrice - maximum buy pricemaxAmount - maximum amount to be boughtmaxCash - maximum amount of cash available.private int calculateBuyAmount(ITradable tradable, int availableAmount, int maxPrice, int bottom, int top, int firstItemPrice, long maxCash)
bottom
end has already been checked and is affordable, so the affordable amount is larger or equal to that.tradable - that should be boughtavailableAmount - amount availablemaxPrice - maximum price that is affordablebottom - amount at the bottom of the range to be checked.top - amount at the top of the range that should be checked.maxCash - maximum amount of cash available.public int sellPrice(ITradable tradable, javafx.beans.property.ReadOnlyIntegerProperty availableAmount, javafx.beans.binding.IntegerBinding amountToSell)
tradable - good that is tradedavailableAmount - amount of the good that is in storeamountToSell - amount to be soldCopyright © 2011-2017 Sahits GmbH. All Rights Reserved.