net.sf.magicproject.action
Class MoveObject

java.lang.Object
  extended by net.sf.magicproject.action.MAction
      extended by net.sf.magicproject.action.UserAction
          extended by net.sf.magicproject.action.MoveObject
All Implemented Interfaces:
LoopAction

public class MoveObject
extends UserAction
implements LoopAction

Move an object from a component to another component.

Since:
0.93
Author:
Fabrice Daugan

Method Summary
 boolean checkObject(Ability ability, Targetable target, int nbObjects)
           
 boolean continueLoop(ContextEventListener context, int loopingIndex, Ability ability)
          Continue this action, giving the next index of this loop.
 Actiontype getIdAction()
          Return the index of this action.
 int getStartIndex()
          Return the first index of this loop.
 java.lang.String toHtmlString(Ability ability, ContextEventListener context)
          Return the HTML code representing this action.
 java.lang.String toHtmlString(Ability ability, int times, ContextEventListener context)
          Return the HTML code representing this action.
 java.lang.String toString(Ability ability)
          String representation of this action.
 
Methods inherited from class net.sf.magicproject.action.UserAction
getActionName, manaNeeded
 
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
 

Method Detail

getIdAction

public Actiontype getIdAction()
Description copied from class: MAction
Return the index of this action. As default, this is a zero id

Specified by:
getIdAction in class UserAction
Returns:
the index of this action.
See Also:
Actiontype

toString

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

Specified by:
toString in class UserAction
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()

toHtmlString

public java.lang.String toHtmlString(Ability ability,
                                     int times,
                                     ContextEventListener context)
Description copied from class: MAction
Return the HTML code representing this action. If this action is named, it's name will be returned. If not, if existing, the picture associated to this action is returned. Otherwise, built-in action's text will be returned.

Overrides:
toHtmlString in class UserAction
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
times - the times to repeat this action.
context - is the context attached to this action.
Returns:
the HTML code representing this action. If this action is named, it's name will be returned. If not, if existing, the picture associated to this action is returned. Otherwise, built-in action's text will be returned.
See Also:
MAction.toString(Ability), MAction.toHtmlString(Ability, ContextEventListener)

toHtmlString

public java.lang.String toHtmlString(Ability ability,
                                     ContextEventListener context)
Description copied from class: MAction
Return the HTML code representing this action. If no picture is associated to this action, only text will be returned.

Overrides:
toHtmlString in class UserAction
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - is the context attached to this action.
Returns:
the HTML code representing this action. If no picture is associated to this action, only text will be returned.
See Also:
MAction.toString(Ability), MAction.toHtmlString(Ability, int, ContextEventListener)

continueLoop

public boolean continueLoop(ContextEventListener context,
                            int loopingIndex,
                            Ability ability)
Description copied from interface: LoopAction
Continue this action, giving the next index of this loop.

Specified by:
continueLoop in interface LoopAction
Parameters:
context - is the context attached to this action.
loopingIndex - the current index
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 action.

checkObject

public boolean checkObject(Ability ability,
                           Targetable target,
                           int nbObjects)
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
target - the component where objects will be removed from
nbObjects - amount of required object
Returns:
true if the specified targetable contains the required object(s)

getStartIndex

public int getStartIndex()
Description copied from interface: LoopAction
Return the first index of this loop.

Specified by:
getStartIndex in interface LoopAction
Returns:
the first index of this loop.


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