|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.Player
public class Player
Player class holds all player-specific data
Field Summary | |
---|---|
static int |
MAX_PLAYERS
|
static int |
MIN_PLAYERS
|
Constructor Summary | |
---|---|
Player(java.lang.String name,
int index)
|
Method Summary | |
---|---|
void |
addCash(int amount)
Add (or subtract) cash. |
boolean |
blockCash(int amount)
Block cash allocated by a bid. |
int |
compareTo(Player p)
Compare Players by their total worth, in descending order. |
int |
getBlockedCash()
|
MoneyModel |
getBlockedCashModel()
|
int |
getCash()
Returns the amount of cash. |
ModelObject |
getCashModel()
|
CertCountModel |
getCertCountModel()
|
int |
getFreeCash()
Return the unblocked cash (available for bidding) |
CalculatedMoneyModel |
getFreeCashModel()
|
int |
getIndex()
|
MoneyModel |
getLastORWorthIncrease()
|
java.lang.String |
getName()
Get the cash owner's name (needed for logging) |
java.lang.String |
getNameAndPriority()
|
Portfolio |
getPortfolio()
|
int |
getWorth()
Get the player's total worth. |
CalculatedMoneyModel |
getWorthModel()
|
boolean |
hasBoughtStockThisTurn()
|
boolean |
isBankrupt()
|
void |
setBankrupt()
|
void |
setIndex(int index)
|
void |
setLastORWorthIncrease()
|
void |
setWorthAtORStart()
|
java.lang.String |
toString()
|
boolean |
unblockCash(int amount)
Unblock cash. |
void |
updateWorth()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int MAX_PLAYERS
public static int MIN_PLAYERS
Constructor Detail |
---|
public Player(java.lang.String name, int index)
Method Detail |
---|
public Portfolio getPortfolio()
public java.lang.String getName()
CashHolder
getName
in interface CashHolder
public java.lang.String getNameAndPriority()
public int getCash()
CashHolder
getCash
in interface CashHolder
public ModelObject getCashModel()
getCashModel
in interface CashHolder
public void addCash(int amount)
CashHolder
addCash
in interface CashHolder
public int getWorth()
public CalculatedMoneyModel getWorthModel()
public MoneyModel getLastORWorthIncrease()
public void setWorthAtORStart()
public void setLastORWorthIncrease()
public void updateWorth()
public CertCountModel getCertCountModel()
public CalculatedMoneyModel getFreeCashModel()
public MoneyModel getBlockedCashModel()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasBoughtStockThisTurn()
public boolean blockCash(int amount)
amount
- Amount of cash to be blocked.
public boolean unblockCash(int amount)
amount
- Amount to be unblocked.
public int getFreeCash()
public int getBlockedCash()
public int getIndex()
public void setIndex(int index)
public void setBankrupt()
public boolean isBankrupt()
public int compareTo(Player p)
compareTo
in interface java.lang.Comparable<Player>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |