|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.Round
rails.game.StartRound
public abstract class StartRound
Field Summary | |
---|---|
protected State |
auctionItemState
|
(package private) PublicCompanyI |
companyNeedingPrice
A company in need for a par price. |
protected Player |
currentPlayer
|
protected boolean |
hasBasePrices
Should the UI show base prices? Not useful if the items are all equal, as in 1841 and 18EU. |
protected boolean |
hasBidding
Should the UI present bidding into and facilities? This value MUST be set in the actual StartRound constructor. |
protected int[] |
itemIndex
|
protected java.util.List<StartItem> |
itemsToSell
|
protected IntegerState |
numPasses
|
protected int |
numPlayers
|
protected StartPacket |
startPacket
|
protected Player |
startPlayer
|
protected java.lang.String |
variant
|
Fields inherited from class rails.game.Round |
---|
autopasses, bank, canRequestTurn, companyManager, gameManager, guiHints, hasRequestedTurn, ipo, log, mapManager, moveStack, playerManager, pool, possibleActions, scrapHeap, stockMarket, unavailable, wasInterrupted |
Constructor Summary | |
---|---|
StartRound(GameManagerI gameManager)
Will be created dynamically. |
Method Summary | |
---|---|
protected void |
assignItem(Player player,
StartItem item,
int price,
int sharePrice)
This method executes the start item buy action. |
protected abstract boolean |
bid(java.lang.String playerName,
BidStartItem startItem)
The current player bids on a given start item. |
protected boolean |
buy(java.lang.String playerName,
BuyStartItem boughtItem)
Buy a start item against the base price. |
protected void |
checksOnBuying(Certificate cert,
int sharePrice)
|
protected void |
finishRound()
|
ModelObject |
getBidModel(int privateIndex,
int playerIndex)
|
ModelObject |
getBlockedCashModel(int playerIndex)
|
int |
getCurrentPlayerIndex()
Get the currentPlayer index in the player list (starting at 0). |
ModelObject |
getFreeCashModel(int playerIndex)
|
ModelObject |
getMinimumBidModel(int privateIndex)
|
java.util.List<StartItem> |
getStartItems()
Get the current list of start items. |
StartPacket |
getStartPacket()
Get a list of items that the current player may bid upon. |
boolean |
hasBasePrices()
|
boolean |
hasBidding()
|
protected abstract boolean |
pass(java.lang.String playerName)
Process a player's pass. |
boolean |
process(PossibleAction action)
|
protected void |
setNextPlayer()
|
protected void |
setPlayer(Player player)
|
protected void |
setPriorityPlayer()
|
void |
start()
Start the start round. |
protected void |
startPacketChecks()
Stub to allow start packet cleanups in subclasses |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected StartPacket startPacket
protected int[] itemIndex
protected java.util.List<StartItem> itemsToSell
protected State auctionItemState
protected IntegerState numPasses
protected int numPlayers
protected java.lang.String variant
protected Player currentPlayer
protected Player startPlayer
protected boolean hasBidding
protected boolean hasBasePrices
PublicCompanyI companyNeedingPrice
Constructor Detail |
---|
public StartRound(GameManagerI gameManager)
Method Detail |
---|
public void start()
startPacket
- The startpacket to be sold in this start round.public boolean process(PossibleAction action)
process
in interface RoundI
process
in class Round
protected void startPacketChecks()
protected abstract boolean bid(java.lang.String playerName, BidStartItem startItem)
playerName
- The name of the current player (for checking purposes).itemName
- The name of the start item on which the bid is placed.amount
- The bid amount.protected boolean buy(java.lang.String playerName, BuyStartItem boughtItem)
playerName
- Name of the buying player.itemName
- Name of the bought start item.sharePrice
- If nonzero: share price if item contains a President's
share
protected void assignItem(Player player, StartItem item, int price, int sharePrice)
player
- Buying player.item
- Start item being bought.price
- Buy price.protected void checksOnBuying(Certificate cert, int sharePrice)
protected abstract boolean pass(java.lang.String playerName)
playerName
- The name of the current player (for checking purposes).protected void finishRound()
finishRound
in class Round
public int getCurrentPlayerIndex()
getCurrentPlayerIndex
in class Round
GameManager.getCurrentPlayerIndex().
protected void setPriorityPlayer()
protected void setPlayer(Player player)
protected void setNextPlayer()
public java.util.List<StartItem> getStartItems()
public StartPacket getStartPacket()
public boolean hasBidding()
public boolean hasBasePrices()
public ModelObject getBidModel(int privateIndex, int playerIndex)
public ModelObject getMinimumBidModel(int privateIndex)
public ModelObject getFreeCashModel(int playerIndex)
public ModelObject getBlockedCashModel(int playerIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |