net.sf.magicproject.action
Class UserAction

java.lang.Object
  extended by net.sf.magicproject.action.MAction
      extended by net.sf.magicproject.action.UserAction
Direct Known Subclasses:
DetachMe, GiveMana, Hop, IntList, MessagingAction, ModifyRegister, MoveCard, MoveObject, ObjectMap, PayMana, RemoveObject, Repeat, Sound, Target, TargetList

public abstract class UserAction
extends MAction

Since:
0.85 named action is supported.
Author:
Fabrice Daugan
See Also:
Actiontype

Method Summary
 java.lang.String getActionName()
          Return the name of this action
abstract  Actiontype getIdAction()
          Return the index of this action.
 int[] manaNeeded(Ability ability, ContextEventListener context)
          Return the amount of mana needed (constant part only) to play this ability As default, we return an empty number for all manas.
 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.
abstract  java.lang.String toString(Ability ability)
          String representation of this action.
 
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 abstract 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 MAction
Returns:
the index of this action.
See Also:
Actiontype

manaNeeded

public int[] manaNeeded(Ability ability,
                        ContextEventListener context)
Description copied from class: MAction
Return the amount of mana needed (constant part only) to play this ability As default, we return an empty number for all manas.

Overrides:
manaNeeded in class MAction
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - the context of playing ability.
Returns:
array of mana needed to play this ability

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 MAction
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)

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 MAction
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)

toString

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

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

getActionName

public java.lang.String getActionName()
Description copied from class: MAction
Return the name of this action

Overrides:
getActionName in class MAction
Returns:
the name of this action


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