net.sf.magicproject.action.target
Class RealTarget

java.lang.Object
  extended by net.sf.magicproject.action.MAction
      extended by net.sf.magicproject.action.UserAction
          extended by net.sf.magicproject.action.Target
              extended by net.sf.magicproject.action.target.ChoosenTarget
                  extended by net.sf.magicproject.action.target.RealTarget
All Implemented Interfaces:
ChoosenAction, InitAction, Replayable, RollBackAction, StandardAction, Waiting, WaitingCard, WaitingPlayer

public final class RealTarget
extends ChoosenTarget
implements InitAction

Add to the target list card(s) or player(s) following the specified mode and the specified type. If mode is 'choose' or 'opponentchoose', then a 'targeted' event is raised when the choice is made. In case of 'all', 'random', 'myself' or any target known with acces register, no event is generated. The friendly test, and the type are required only for the modes 'random', 'all', 'choose' and 'opponentchoose' to list the valids targets. The target list is used by the most actions.
For example, if the next action 'damage', all cards/player from the target list would be damaged. When a new ability is added to the stack, a new list is created and attached to it. Actions may modify, acceess it until the ability is completely resolved.

Since:
0.86
Author:
Fabrice Daugan

Method Summary
 boolean choose(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
          No generated event.
 boolean isTargeting()
          Is this action is really targeting.
 java.lang.String toString(Ability ability)
          String representation of this action.
 
Methods inherited from class net.sf.magicproject.action.target.ChoosenTarget
checkTarget, clickOn, clickOn, disactivate, finished, init, isValidTarget, isValidTarget, manualSkip, play, replay, rollback, succeedClickOn, succeedClickOn, toHtmlString
 
Methods inherited from class net.sf.magicproject.action.Target
getIdAction
 
Methods inherited from class net.sf.magicproject.action.UserAction
getActionName, manaNeeded, toHtmlString, toHtmlString
 
Methods inherited from class net.sf.magicproject.action.MAction
equal, parseTest, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.magicproject.action.handler.InitAction
init, replay
 

Method Detail

toString

public java.lang.String toString(Ability ability)
Description copied from class: MAction
String representation of this action.

Overrides:
toString in class ChoosenTarget
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
Returns:
action name.
See Also:
Object.toString()

choose

public boolean choose(ActionContextWrapper actionContext,
                      ContextEventListener context,
                      Ability ability)
Description copied from interface: ChoosenAction
No generated event. Let the active player playing this action.

Specified by:
choose in interface ChoosenAction
Overrides:
choose in class ChoosenTarget
Parameters:
actionContext - the context containing data saved by this action during the 'choose" proceess.
context - is the context attached to this action.
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
Returns:
true if the stack can be resolved just after this call.

isTargeting

public boolean isTargeting()
Description copied from class: ChoosenTarget
Is this action is really targeting.

Specified by:
isTargeting in class ChoosenTarget
Returns:
true if this action is really targeting.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.