de.torfu.kabayellow.common
Class ActionCard

java.lang.Object
  |
  +--de.torfu.kabayellow.common.Action
        |
        +--de.torfu.kabayellow.common.ActionCard
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ActionCard6Points, ActionCard7Points, ActionCardExtraStone, ActionCardKnight, ActionCardMoveStone, ActionCardStoneUnderKnight, ActionCardUnknown

public abstract class ActionCard
extends Action

Abstrakte Superclasse aller Aktionskarten


Field Summary
static int ANY_GATE
           
static int EXTRA_STONE
           
static int JUMP
           
static int MOVE_DIAGONAL
           
static int MOVE_STONE
           
static int REACTIVATE_KNIGHT
           
static int SEVEN_POINTS
           
static int SIX_POINTS
           
static int STONE_UNDER_KNIGHT
           
static int TWO_LEVELS
           
static int UNKNOWN
           
 
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 canPlayCard(Game game)
           
static ActionCard create(int number)
          Erzeugt die ActionCard mit der angegebenen Nummer.
static ActionCard createUnknown()
           
 int getColor()
           
 int getNumber()
           
abstract  java.lang.String getText()
          Gibt den Text, der auf der Karte steht aus
 int getType()
          Gibt den Typ der Karte als ActionCard.XXX-Konstante zurück
 boolean isActionCard()
          Gibt zurück, ob diese Action einen Ritter verändert (bewegt oder einsetzt).
 java.lang.String toServer()
           
 java.lang.String toString()
           
 
Methods inherited from class de.torfu.kabayellow.common.Action
clone, execute, getActionMoveKnightsForLongMove, getCost, getCostsOfPossibleMoves, getEndPoint4Move, getError, getErrorCode, getID, getPointFromIndex, getPossibleEndPoints, getPossibleLocations, getPossibleLongMoves, getPossibleMoves, getPossibleSetKnight, getPossibleStartPoints, getStartPoint, getStartPoint4Move, hasStartPoint, isBuyCardAction, isKingAction, isKnightAction, isLegal, isnewKnightAction, isStoneAction, needsOnePoint, needsParameters, needsTwoPoints, setEndPoint, setID, setPoint, setPoint, setPoints, setStartPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

MOVE_STONE

public static final int MOVE_STONE
See Also:
Constant Field Values

MOVE_DIAGONAL

public static final int MOVE_DIAGONAL
See Also:
Constant Field Values

STONE_UNDER_KNIGHT

public static final int STONE_UNDER_KNIGHT
See Also:
Constant Field Values

REACTIVATE_KNIGHT

public static final int REACTIVATE_KNIGHT
See Also:
Constant Field Values

TWO_LEVELS

public static final int TWO_LEVELS
See Also:
Constant Field Values

JUMP

public static final int JUMP
See Also:
Constant Field Values

EXTRA_STONE

public static final int EXTRA_STONE
See Also:
Constant Field Values

ANY_GATE

public static final int ANY_GATE
See Also:
Constant Field Values

SIX_POINTS

public static final int SIX_POINTS
See Also:
Constant Field Values

SEVEN_POINTS

public static final int SEVEN_POINTS
See Also:
Constant Field Values
Method Detail

isActionCard

public boolean isActionCard()
Description copied from class: Action
Gibt zurück, ob diese Action einen Ritter verändert (bewegt oder einsetzt).

Overrides:
isActionCard in class Action

canPlayCard

public int canPlayCard(Game game)

getText

public abstract java.lang.String getText()
Gibt den Text, der auf der Karte steht aus


getType

public int getType()
Gibt den Typ der Karte als ActionCard.XXX-Konstante zurück


getColor

public int getColor()

getNumber

public int getNumber()

create

public static ActionCard create(int number)
Erzeugt die ActionCard mit der angegebenen Nummer. Nummer ist dabei im Bereich 0-39.


createUnknown

public static ActionCard createUnknown()

toString

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

toServer

public java.lang.String toServer()
Overrides:
toServer in class Action