|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrails.game.action.PossibleAction
public abstract class PossibleAction
PossibleAction is the superclass of all classes that describe an allowed user action (such as laying a tile or dropping a token on a specific hex, buying a train etc.).
Field Summary | |
---|---|
protected boolean |
acted
|
protected GameManagerI |
gameManager
|
protected static org.apache.log4j.Logger |
log
|
protected int |
playerIndex
|
protected java.lang.String |
playerName
|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
PossibleAction()
|
Method Summary | |
---|---|
abstract boolean |
equalsAsAction(PossibleAction pa)
Compare the chosen actions of two action objects. |
abstract boolean |
equalsAsOption(PossibleAction pa)
Compare the choice options of two action objects, without regard to whatever choice has been made, if any. |
protected CompanyManagerI |
getCompanyManager()
|
protected GameManagerI |
getGameManager()
|
int |
getPlayerIndex()
|
java.lang.String |
getPlayerName()
|
boolean |
hasActed()
|
void |
setActed()
|
void |
setPlayerName(java.lang.String playerName)
Set the name of the player who executed the action (as opposed to the player who was allowed to do the action, which is the one set in the constructor). |
java.lang.String |
toMenu()
Default version of an Menu item text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String playerName
protected int playerIndex
protected transient GameManagerI gameManager
protected boolean acted
public static final long serialVersionUID
protected static org.apache.log4j.Logger log
Constructor Detail |
---|
public PossibleAction()
Method Detail |
---|
public java.lang.String getPlayerName()
public int getPlayerIndex()
public void setPlayerName(java.lang.String playerName)
playerName
- public boolean hasActed()
public void setActed()
public abstract boolean equalsAsOption(PossibleAction pa)
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).
pa
- Another PossibleAction to compare with.
public abstract boolean equalsAsAction(PossibleAction pa)
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).
pa
- Another PossibleAction to compare with.
protected GameManagerI getGameManager()
protected CompanyManagerI getCompanyManager()
public java.lang.String toMenu()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |