rails.game.correct
Class MapCorrectionAction

java.lang.Object
  extended by rails.game.action.PossibleAction
      extended by rails.game.correct.CorrectionAction
          extended by rails.game.correct.MapCorrectionAction
All Implemented Interfaces:
java.io.Serializable

public class MapCorrectionAction
extends CorrectionAction

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          The Constant serialVersionUID.
 
Fields inherited from class rails.game.correct.CorrectionAction
correctionName, correctionType
 
Fields inherited from class rails.game.action.PossibleAction
acted, gameManager, log, playerIndex, playerName
 
Constructor Summary
MapCorrectionAction()
          Instantiates a new map tile correction action.
 
Method Summary
 boolean equalsAsAction(PossibleAction action)
          Compare the chosen actions of two action objects.
 boolean equalsAsOption(PossibleAction action)
          Compare the choice options of two action objects, without regard to whatever choice has been made, if any.
 TileI getChosenTile()
           
 MapHex getLocation()
           
 MapCorrectionManager.ActionStep getNextStep()
           
 int getOrientation()
           
 java.util.List<Station> getPossibleStations()
           
 java.util.List<Station> getStationsForRelay()
           
 MapCorrectionManager.ActionStep getStep()
           
 java.util.List<TileI> getTiles()
           
 java.util.List<BaseToken> getTokensToRelay()
           
 MapCorrectionManager.ActionStep moveToNextStep()
           
 void selectCancel()
           
 void selectConfirmed()
           
 void selectHex(MapHex chosenHex)
           
 void selectOrientation(int orientation)
           
 void selectRelayBaseTokens(java.util.List<Station> chosenStations)
           
 void selectTile(TileI chosenTile)
           
(package private)  void setNextStep(MapCorrectionManager.ActionStep step)
           
(package private)  void setPossibleStations(java.util.List<Station> possibleStations)
           
(package private)  void setTiles(java.util.List<TileI> tiles)
           
(package private)  void setTokensToRelay(java.util.List<BaseToken> tokens)
           
 java.lang.String toString()
           
 
Methods inherited from class rails.game.correct.CorrectionAction
getCorrectionName, getCorrectionType, setCorrectionType
 
Methods inherited from class rails.game.action.PossibleAction
getCompanyManager, getGameManager, getPlayerIndex, getPlayerName, hasActed, setActed, setPlayerName, toMenu
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
The Constant serialVersionUID.

See Also:
Constant Field Values
Constructor Detail

MapCorrectionAction

public MapCorrectionAction()
Instantiates a new map tile correction action. start with select hex

Method Detail

getLocation

public MapHex getLocation()

getTiles

public java.util.List<TileI> getTiles()

getChosenTile

public TileI getChosenTile()

setTiles

void setTiles(java.util.List<TileI> tiles)

getStationsForRelay

public java.util.List<Station> getStationsForRelay()

getTokensToRelay

public java.util.List<BaseToken> getTokensToRelay()

setTokensToRelay

void setTokensToRelay(java.util.List<BaseToken> tokens)

getPossibleStations

public java.util.List<Station> getPossibleStations()

setPossibleStations

void setPossibleStations(java.util.List<Station> possibleStations)

getOrientation

public int getOrientation()

getNextStep

public MapCorrectionManager.ActionStep getNextStep()

setNextStep

void setNextStep(MapCorrectionManager.ActionStep step)

getStep

public MapCorrectionManager.ActionStep getStep()

selectHex

public void selectHex(MapHex chosenHex)

selectTile

public void selectTile(TileI chosenTile)

selectConfirmed

public void selectConfirmed()

selectOrientation

public void selectOrientation(int orientation)

selectRelayBaseTokens

public void selectRelayBaseTokens(java.util.List<Station> chosenStations)

selectCancel

public void selectCancel()

moveToNextStep

public MapCorrectionManager.ActionStep moveToNextStep()

equalsAsOption

public boolean equalsAsOption(PossibleAction action)
Description copied from class: PossibleAction
Compare the choice options of two action objects, without regard to whatever choice has been made, if any. In other words: only the server-set (prior) attributes must be compared.

This method is used by the server (engine) to validate the incoming action that has actually been chosen in the client (GUI), but only for the purpose to check if the chosen option was really on offer, not to check if the chosen action is actually valid. These perspectives could give different results in cases where the PossibleAction does not fully restrict choices to valid values only (such as the blanket LayTile that does no restrict the hex to lay a tile on, or the SetDividend that will accept any revenue value).

Specified by:
equalsAsOption in class PossibleAction
Parameters:
action - Another PossibleAction to compare with.
Returns:
True if the compared PossibleAction object has equal choice options.

equalsAsAction

public boolean equalsAsAction(PossibleAction action)
Description copied from class: PossibleAction
Compare the chosen actions of two action objects. In other words: the client-set (posterior) attributes must be compared, in addition to those server-set (prior) attributes that sufficiently identify the action.

This method is used by the server (engine) to check if two action objects represent the same actual action, as is done when reloading a saved file (i.e. loading a later stage of the same game).

Specified by:
equalsAsAction in class PossibleAction
Parameters:
action - Another PossibleAction to compare with.
Returns:
True if the compared PossibleAction object has equal selected action values.

toString

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