public class ComputablePriceV2
extends java.lang.Object
| Constructor | Description |
|---|---|
ComputablePriceV2() |
| Modifier and Type | Method | Description |
|---|---|---|
int |
buyPrice(ITradable tradable,
javafx.beans.property.ReadOnlyIntegerProperty availableAmount,
javafx.beans.binding.IntegerBinding amountToBuy) |
Integer binding calculation for the buy price.
|
int |
calculateAffordableAmount(ITradable tradable,
int availableAmount,
int maxAmount,
long cash) |
Calculate the amount that can be afforded based on available cash.
|
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) |
Calculate the amount that can be sold while maintaining a minimal average price per item.
|
int |
sellPrice(ITradable tradable,
javafx.beans.property.ReadOnlyIntegerProperty availableAmount,
javafx.beans.binding.IntegerBinding amountToSell) |
Integer binding calculation of the sell price.
|
public int calculateSellAmount(ITradable tradable, int availableAmount, int minPrice, int maxSellAmount)
tradable - good that is to be soldavailableAmount - available amount in the target of tradableminPrice - minimal avg price that may not be transgressed.maxSellAmount - maximal amount that should be sold.public 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 price per itemmaxAmount - maximum amount to be boughtmaxCash - maximum amount of cash available.public int calculateAffordableAmount(ITradable tradable, int availableAmount, int maxAmount, long cash)
tradable - that should be boughtavailableAmount - amount that is availablemaxAmount - maximum amount that should be boughtcash - available cash reserves.maxAmount].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-2018 Sahits GmbH. All Rights Reserved.