rails.game
Class ShareSellingRound

java.lang.Object
  extended by rails.game.Round
      extended by rails.game.StockRound
          extended by rails.game.ShareSellingRound
All Implemented Interfaces:
RoundI
Direct Known Subclasses:
ShareSellingRound_1856

public class ShareSellingRound
extends StockRound

Author:
Erik Vos

Field Summary
(package private)  PublicCompanyI cashNeedingCompany
           
(package private)  IntegerState cashToRaise
           
(package private)  boolean dumpOtherCompaniesAllowed
           
(package private)  RoundI parentRound
           
(package private)  Player sellingPlayer
           
 
Fields inherited from class rails.game.StockRound
BOUGHT, companyBoughtThisTurnWrapper, currentPlayer, hasActed, hasSoldThisTurnBeforeBuying, numberOfPlayers, numPasses, playersThatSoldThisRound, SELL_BUY, SELL_BUY_OR_BUY_SELL, SELL_BUY_SELL, sellObligationLifted, sellPrices, sequenceRule, SOLD, startingPlayer
 
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
ShareSellingRound(GameManagerI gameManager, RoundI parentRound)
          Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and and other parameters used by the Share Selling Round Class
 
Method Summary
 PublicCompanyI getCompanyNeedingCash()
           
 int getRemainingCashToRaise()
           
 boolean mayCurrentPlayerBuyAnything()
          Can the current player do any buying?
 boolean mayCurrentPlayerSellAnything()
          Can the current player do any selling?
 boolean sellShares(SellShares action)
           
 boolean setPossibleActions()
          Default version, does nothing.
 void setSellableShares()
          Create a list of certificates that a player may sell in a Stock Round, taking all rules taken into account.
 void start(Player sellingPlayer, int cashToRaise, PublicCompanyI cashNeedingCompany, boolean dumpOtherCompaniesAllowed)
           
 java.lang.String toString()
           
 
Methods inherited from class rails.game.StockRound
adjustSharePrice, buyShares, checkAgainstHoldLimit, done, executeExchangeForShare, executeShareTransfer, finishRound, finishTurn, gameSpecificChecks, getBuyPrice, getCurrentPlayerIndex, getCurrentSellPrice, getHelp, getRoundName, getSharePriceRecipient, getStockRoundNumber, initPlayer, isPlayerOverLimits, isPlayerOverLimitsDetail, isSaleRecorded, isSellObligationLifted, maxAllowedNumberOfSharesToBuy, mayPlayerBuyCertificate, mayPlayerSellShareOfCompany, noSaleIfNotOperated, noSaleInFirstSR, process, processGameSpecificAction, recordSale, releaseCompanyShares, requestTurn, setBuyableCerts, setCurrentPlayer, setGameSpecificActions, setNextPlayer, setPriority, setSellObligationLifted, setSpecialActions, start, startCompany, useSpecialProperty
 
Methods inherited from class rails.game.Round
canCompanyOperateThisRound, canRequestTurn, certCountsAsSold, checkFlotation, exchangeTokens, floatCompany, getAutopasses, getCurrentPhase, getCurrentPlayer, getGameManager, getGameOption, getGameParameter, getGameParameterAsBoolean, getGameParameterAsInt, getNumberOfActivePlayers, getNumberOfPlayers, getPlayers, getRoundTypeForUI, getSoldPercentage, getSpecialProperties, hasAutopassed, pay, pay, requestTurn, resume, setAutopass, setCanRequestTurn, setCurrentPlayerIndex, setOperatingCompanies, setOperatingCompanies, transferCertificate, transferCertificates, wasInterrupted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parentRound

RoundI parentRound

sellingPlayer

Player sellingPlayer

cashToRaise

IntegerState cashToRaise

cashNeedingCompany

PublicCompanyI cashNeedingCompany

dumpOtherCompaniesAllowed

boolean dumpOtherCompaniesAllowed
Constructor Detail

ShareSellingRound

public ShareSellingRound(GameManagerI gameManager,
                         RoundI parentRound)
Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize, and and other parameters used by the Share Selling Round Class

Parameters:
aGameManager - The GameManager Object needed to initialize the StockRound Class
compNeedingTraing - The PublicCompanyI Object that needs to buy the train, who is limited on selling shares of
cashToRaise - The amount of cash needed to be raised during the special sell-off
Method Detail

start

public void start(Player sellingPlayer,
                  int cashToRaise,
                  PublicCompanyI cashNeedingCompany,
                  boolean dumpOtherCompaniesAllowed)

mayCurrentPlayerSellAnything

public boolean mayCurrentPlayerSellAnything()
Description copied from class: StockRound
Can the current player do any selling?

Overrides:
mayCurrentPlayerSellAnything in class StockRound
Returns:
True if any selling is allowed.

mayCurrentPlayerBuyAnything

public boolean mayCurrentPlayerBuyAnything()
Description copied from class: StockRound
Can the current player do any buying?

Overrides:
mayCurrentPlayerBuyAnything in class StockRound
Returns:
True if any buying is allowed.

setPossibleActions

public boolean setPossibleActions()
Description copied from class: Round
Default version, does nothing. Subclasses should override this method with a real version.

Specified by:
setPossibleActions in interface RoundI
Overrides:
setPossibleActions in class StockRound

setSellableShares

public void setSellableShares()
Description copied from class: StockRound
Create a list of certificates that a player may sell in a Stock Round, taking all rules taken into account.

Overrides:
setSellableShares in class StockRound

sellShares

public boolean sellShares(SellShares action)
Overrides:
sellShares in class StockRound

getRemainingCashToRaise

public int getRemainingCashToRaise()

getCompanyNeedingCash

public PublicCompanyI getCompanyNeedingCash()

toString

public java.lang.String toString()
Overrides:
toString in class StockRound