public class WareAmountCalculator extends Object
| Constructor and Description |
|---|
WareAmountCalculator() |
| Modifier and Type | Method and Description |
|---|---|
private int |
calculateAmount(IWare ware,
ICity city,
int avgPrice,
boolean buying) |
private int |
calculateAvgPrice(IWare ware,
javafx.beans.property.IntegerProperty availableAmount,
int amount,
boolean buying) |
int |
calculateBuyAmount(IWare ware,
ICity city,
int avgPrice)
Calculate the amount of
ware that can be bought
for at most avgPrice. |
int |
calculateSellAmount(IWare ware,
ICity city,
int avgPrice)
Calculate the amount of
ware that can be sold
for before dropping below avgPrice. |
(package private) int |
searchAvgPrice(IWare ware,
javafx.beans.property.IntegerProperty availableAmount,
int avgPrice,
int lowerAmount,
int upperAmount,
boolean buying) |
public int calculateBuyAmount(IWare ware, ICity city, int avgPrice)
ware that can be bought
for at most avgPrice.ware - to be boughtcity - from which to buyavgPrice - for one item to be boughtavgPrice.public int calculateSellAmount(IWare ware, ICity city, int avgPrice)
ware that can be sold
for before dropping below avgPrice.ware - to be soldcity - to which to sellavgPrice - for one item to be soldavgPrice.int searchAvgPrice(IWare ware, javafx.beans.property.IntegerProperty availableAmount, int avgPrice, int lowerAmount, int upperAmount, boolean buying)
private int calculateAvgPrice(IWare ware, javafx.beans.property.IntegerProperty availableAmount, int amount, boolean buying)
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.