de.torfu.kabayellow.common
Class ActionMoveKnight
java.lang.Object
|
+--de.torfu.kabayellow.common.Action
|
+--de.torfu.kabayellow.common.ActionMoveKnight
- All Implemented Interfaces:
- java.lang.Cloneable
- public class ActionMoveKnight
- extends Action
Bewegt einen Ritter.
Start- und Zielpunkt müssen mit Action.setPoints(Point, Point)
oder mit Action.setStartPoint(Point)
und
Action.setEndPoint(Point)
festgelegt werden.
Fields inherited from class de.torfu.kabayellow.common.Action |
ERROR_ACTIONCARD_IS_NEW, ERROR_CARD_NOT_NEEDED, ERROR_CASTLE_PROPERTY_VIOLATED, ERROR_CASTLE_SPLIT, ERROR_CODE_NONE, ERROR_DOESNT_HAVE_ACTIONCARD, ERROR_ILLEGAL_MOVE, ERROR_ILLEGAL_MOVE_THROUGH_CASTLE, ERROR_IMPOSSIBLE_MOVE, ERROR_KNIGHT_ON_TARGET_CELL, ERROR_MOVE_TOO_LONG, ERROR_NEW_CASTLE, ERROR_NO_ACTIONPOINTS_LEFT, ERROR_NO_ADJACENT_KNIGHT, ERROR_NO_CASTLE, ERROR_NO_KNIGHT_FOUND, ERROR_NO_MORE_CARDS_LEFT, ERROR_NO_MORE_KNIGHTS_LEFT, ERROR_NO_STONES_LEFT, ERROR_NO_STRAIGHT_MOVE, ERROR_NOT_ENOUGH_CASTLES, ERROR_ONLY_TWO_CARDS_ALLOWED, ERROR_PLAY_ONLY_ONE_CARD, ERROR_TOO_FEW_CASTLE, ERROR_TOO_HIGH, ERROR_WRONG_ROUND |
Method Summary |
int |
getCost(Game game)
Gibt zurück, wie viele Aktionspunkte dieser Zug
kostet. 0, falls nicht überschrieben. |
int |
getErrorCode(Game game)
Rasmus schlägt vor nur diese Fehler zurückzugeben
ERROR_ILLEGAL_MOVE ( neu )
ERROR_NO_KNIGHT_FOUND
weil bei längeren Zügen so genaue Unterscheidungen nicht
möglich sind
Überprüft, ob der Zug den Regeln entspricht.
|
java.util.Vector |
getPossibleStartPoints(Game game)
Gibt einen Vector mit allen legalen Startfeldern für diese
Aktion zurück. |
Methods inherited from class de.torfu.kabayellow.common.Action |
clone, execute, getActionMoveKnightsForLongMove, getCostsOfPossibleMoves, getEndPoint4Move, getError, getID, getPointFromIndex, getPossibleEndPoints, getPossibleLocations, getPossibleLongMoves, getPossibleMoves, getPossibleSetKnight, getStartPoint, getStartPoint4Move, hasStartPoint, isActionCard, isBuyCardAction, isKingAction, isKnightAction, isLegal, isnewKnightAction, isStoneAction, needsOnePoint, needsParameters, needsTwoPoints, setEndPoint, setID, setPoint, setPoint, setPoints, setStartPoint, toServer, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ActionMoveKnight
public ActionMoveKnight()
getErrorCode
public int getErrorCode(Game game)
- Rasmus schlägt vor nur diese Fehler zurückzugeben
ERROR_ILLEGAL_MOVE ( neu )
ERROR_NO_KNIGHT_FOUND
weil bei längeren Zügen so genaue Unterscheidungen nicht
möglich sind
Überprüft, ob der Zug den Regeln entspricht.
Gibt folgende Error-Codes zurück:
- ERROR_KNIGHT_ON_TARGET_CELL
- ERROR_NO_ACTIONPOINTS_LEFT
- ERROR_TOO_HIGH
- ERROR_NO_STRAIGHT_MOVE
- ERROR_ILLEGAL_MOVE_THROUGH_CASTLE
- ERROR_MOVE_TOO_LONG
- ERROR_NO_KNIGHT_FOUND
- Specified by:
getErrorCode
in class Action
getPossibleStartPoints
public java.util.Vector getPossibleStartPoints(Game game)
- Description copied from class:
Action
- Gibt einen
Vector
mit allen legalen Startfeldern für diese
Aktion zurück.
- Overrides:
getPossibleStartPoints
in class Action
getCost
public int getCost(Game game)
- Description copied from class:
Action
- Gibt zurück, wie viele Aktionspunkte dieser Zug
kostet. 0, falls nicht überschrieben.
- Overrides:
getCost
in class Action