public class StockPriceCalculator
- extends java.lang.Object
Calculates the stock price for each of the players.
Stock price = [Net worth + 5 * profit last year] / [ shares owned by public +
0.5 shares owned by other players]
Let profit last year = 100,000 in the first year.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final ReadOnlyWorld w
public StockPriceCalculator(ReadOnlyWorld w)
public StockPriceCalculator.StockPrice calculate()
boolean isFirstYear(int playerId)
- Returns true if the current time in the same year as the first transaction for the
long netWorth(int playerId)
- Returns the players networth at the start of this year.
long profitsLastYear(int playerId)
int sharesOwnedByPublic(int playerId)
int sharesOwnedByOtherPlayers(int playerId)
static Money calStockPrice(long netWorth,