rails.game.special
Class SpecialTrainBuy

java.lang.Object
  extended by rails.game.special.SpecialProperty
      extended by rails.game.special.SpecialTrainBuy
All Implemented Interfaces:
ConfigurableComponentI, Moveable, SpecialPropertyI

public class SpecialTrainBuy
extends SpecialProperty

Special private ability involving deductions in train buying. The deduction can be absolute (an amount) or relative (a percentage)

Author:
Erik Vos

Nested Class Summary
 
Nested classes/interfaces inherited from interface rails.game.special.SpecialPropertyI
SpecialPropertyI.Priority
 
Field Summary
(package private)  boolean absoluteDeduction
           
(package private)  int deductionAmount
           
(package private)  java.lang.String deductionString
           
(package private)  boolean extra
           
(package private)  java.lang.String name
           
(package private)  boolean relativeDeduction
           
(package private)  java.lang.String trainTypeName
           
 
Fields inherited from class rails.game.special.SpecialProperty
closingValue, conditionText, description, exercised, gameManager, holder, isORProperty, isSRProperty, lastIndex, log, originalCompany, permanent, priority, spMap, transferText, uniqueId, usableDuringOR, usableDuringSR, usableDuringTileLayingStep, usableDuringTokenLayingStep, usableIfOwnedByCompany, usableIfOwnedByPlayer, whenText
 
Fields inherited from interface rails.game.special.SpecialPropertyI
DEFAULT_PRIORITY
 
Fields inherited from interface rails.game.move.Moveable
AT_END
 
Constructor Summary
SpecialTrainBuy()
           
 
Method Summary
 void configureFromXML(Tag tag)
          Instructs the component to configure itself from the provided XML element.
 int getDeductionAmount()
           
 java.lang.String getDeductionString()
           
 java.lang.String getInfo()
          Default Info text.
 java.lang.String getName()
           
 int getPrice(int standardPrice)
           
 java.lang.String getTrainTypeName()
           
 boolean isAbsoluteDeduction()
           
 boolean isExecutionable()
           
 boolean isExtra()
           
 boolean isFree()
           
 boolean isRelativeDeduction()
           
 boolean isValidForTrainType(java.lang.String trainType)
           
 java.lang.String toMenu()
          Default menu item text, should be by all special properties that can appear as a menu item
 java.lang.String toString()
           
 
Methods inherited from class rails.game.special.SpecialProperty
finishConfiguration, getByUniqueId, getClosingValue, getHelp, getHolder, getOriginalCompany, getPriority, getTransferText, getUniqueId, init, isExercised, isORProperty, isSRProperty, isUsableDuringOR, isUsableDuringSR, isUsableDuringTileLayingStep, isUsableDuringTokenLayingStep, isUsableIfOwnedByCompany, isUsableIfOwnedByPlayer, moveTo, setCompany, setExercised, setExercised, setHolder, setPriority, setUsableDuringOR, setUsableDuringSR, setUsableDuringTileLayingStep, setUsableDuringTokenLayingStep, setUsableIfOwnedByCompany, setUsableIfOwnedByPlayer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

java.lang.String name

trainTypeName

java.lang.String trainTypeName

extra

boolean extra

deductionString

java.lang.String deductionString

relativeDeduction

boolean relativeDeduction

absoluteDeduction

boolean absoluteDeduction

deductionAmount

int deductionAmount
Constructor Detail

SpecialTrainBuy

public SpecialTrainBuy()
Method Detail

configureFromXML

public void configureFromXML(Tag tag)
                      throws ConfigurationException
Description copied from interface: ConfigurableComponentI
Instructs the component to configure itself from the provided XML element.

Specified by:
configureFromXML in interface ConfigurableComponentI
Overrides:
configureFromXML in class SpecialProperty
Throws:
ConfigurationException

getPrice

public int getPrice(int standardPrice)

isValidForTrainType

public boolean isValidForTrainType(java.lang.String trainType)

isExecutionable

public boolean isExecutionable()

isExtra

public boolean isExtra()

isFree

public boolean isFree()

getName

public java.lang.String getName()

isAbsoluteDeduction

public boolean isAbsoluteDeduction()

getDeductionAmount

public int getDeductionAmount()

getDeductionString

public java.lang.String getDeductionString()

isRelativeDeduction

public boolean isRelativeDeduction()

getTrainTypeName

public java.lang.String getTrainTypeName()

toString

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

toMenu

public java.lang.String toMenu()
Description copied from class: SpecialProperty
Default menu item text, should be by all special properties that can appear as a menu item

Specified by:
toMenu in interface SpecialPropertyI
Overrides:
toMenu in class SpecialProperty

getInfo

public java.lang.String getInfo()
Description copied from class: SpecialProperty
Default Info text. To be overridden where useful.

Specified by:
getInfo in interface SpecialPropertyI
Overrides:
getInfo in class SpecialProperty