rails.game.specific._1835
Class StockRound_1835

java.lang.Object
  extended by rails.game.Round
      extended by rails.game.StockRound
          extended by rails.game.specific._1835.StockRound_1835
All Implemented Interfaces:
RoundI

public class StockRound_1835
extends StockRound


Field Summary
 
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
StockRound_1835(GameManagerI aGameManager)
          Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize
 
Method Summary
protected  void adjustSharePrice(PublicCompanyI company, int numberSold, boolean soldBefore)
          Share price goes down 1 space for any number of shares sold.
 boolean checkAgainstHoldLimit(Player player, PublicCompanyI company, int number)
          Check if a player may buy the given number of shares from a given company, given the "hold limit" per company, that is the percentage of shares of one company that a player may hold (typically 60%).
protected  void gameSpecificChecks(Portfolio boughtFrom, PublicCompanyI company)
          The company release rules for 1835.
protected  int getBuyPrice(BuyCertificate action, StockSpaceI currentSpace)
          Allow different price setting in subclasses (i.e.
protected  int getCurrentSellPrice(PublicCompanyI company)
           
protected  void setGameSpecificActions()
          Add nationalisations
 
Methods inherited from class rails.game.StockRound
buyShares, done, executeExchangeForShare, executeShareTransfer, finishRound, finishTurn, getCurrentPlayerIndex, getHelp, getRoundName, getSharePriceRecipient, getStockRoundNumber, initPlayer, isPlayerOverLimits, isPlayerOverLimitsDetail, isSaleRecorded, isSellObligationLifted, maxAllowedNumberOfSharesToBuy, mayCurrentPlayerBuyAnything, mayCurrentPlayerSellAnything, mayPlayerBuyCertificate, mayPlayerSellShareOfCompany, noSaleIfNotOperated, noSaleInFirstSR, process, processGameSpecificAction, recordSale, releaseCompanyShares, requestTurn, sellShares, setBuyableCerts, setCurrentPlayer, setNextPlayer, setPossibleActions, setPriority, setSellableShares, setSellObligationLifted, setSpecialActions, start, startCompany, toString, 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
 

Constructor Detail

StockRound_1835

public StockRound_1835(GameManagerI aGameManager)
Constructor with the GameManager, will call super class (StockRound's) Constructor to initialize

Parameters:
aGameManager - The GameManager Object needed to initialize the Stock Round
Method Detail

setGameSpecificActions

protected void setGameSpecificActions()
Add nationalisations

Overrides:
setGameSpecificActions in class StockRound

checkAgainstHoldLimit

public boolean checkAgainstHoldLimit(Player player,
                                     PublicCompanyI company,
                                     int number)
Description copied from class: StockRound
Check if a player may buy the given number of shares from a given company, given the "hold limit" per company, that is the percentage of shares of one company that a player may hold (typically 60%).

Overrides:
checkAgainstHoldLimit in class StockRound
Parameters:
player - the buying player
company - The company from which to buy
number - The number of shares (usually 1 but not always so)
Returns:
True if it is allowed.

getBuyPrice

protected int getBuyPrice(BuyCertificate action,
                          StockSpaceI currentSpace)
Description copied from class: StockRound
Allow different price setting in subclasses (i.e. 1835 Nationalisation)

Overrides:
getBuyPrice in class StockRound

getCurrentSellPrice

protected int getCurrentSellPrice(PublicCompanyI company)
Overrides:
getCurrentSellPrice in class StockRound

adjustSharePrice

protected void adjustSharePrice(PublicCompanyI company,
                                int numberSold,
                                boolean soldBefore)
Share price goes down 1 space for any number of shares sold.

Overrides:
adjustSharePrice in class StockRound

gameSpecificChecks

protected void gameSpecificChecks(Portfolio boughtFrom,
                                  PublicCompanyI company)
The company release rules for 1835. For now these rules are hardcoded (which makes this code vulnerable to company name changes!). It did not seem worthwhile to invent come complex XML for the unique 1835 rules on this matter.

Overrides:
gameSpecificChecks in class StockRound
Parameters:
boughtfrom - The portfolio from which a certificate has been bought.
company - The company of which a share has been traded.