net.sf.magicproject.clickable.ability
Class RemoveModifier

java.lang.Object
  extended by net.sf.magicproject.clickable.ability.Ability
      extended by net.sf.magicproject.clickable.ability.AbstractAbility
          extended by net.sf.magicproject.clickable.ability.RemoveModifier
All Implemented Interfaces:
Unregisterable, ResolveStackHandler
Direct Known Subclasses:
ModifierRemover

public class RemoveModifier
extends AbstractAbility

Author:
Fabrice Daugan

Field Summary
 Unregisterable modifier
          The modifier to remove with this action
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Constructor Summary
RemoveModifier(TriggeredEvent event, Unregisterable modifier)
          Creates a new instance of RemoveModifier
 
Method Summary
 boolean equals(ContextEventListener thisContext, Ability ability, ContextEventListener context)
          Compare two abilities the specified ability to the TBZ.
 java.lang.String getAbilityTitle()
          Return ability html title.
 MCard getCard()
          Return card where is this ability.
 java.lang.String getLog(ContextEventListener context)
          Return a String identifying this ability with the name and/or card name.
 int hashCode()
           
 void optimizeRegisterToManager()
          Register this abilty to manager trying to append test on existing ability with same effects.
 void removeFromManager()
          Remove from the event manager this listener.
 java.lang.String toString()
           
 boolean triggerIt(ContextEventListener context)
          called when this ability is going to be triggered This method would add this ability to the triggered zone, or perform another play action
 
Methods inherited from class net.sf.magicproject.clickable.ability.AbstractAbility
actionList, effectList, isMatching, recheckTargets
 
Methods inherited from class net.sf.magicproject.clickable.ability.Ability
addLinkedAbility, checkObjectActions, checkTargetActions, clone, eventComing, getCardCopy, getController, getName, getPictureName, getTargetable, getTriggeredClone, getTriggeredCloneChoice, hasHighPriority, isAutoResolve, isHidden, isPlayAsSpell, manaNeeded, registerToManager, resolveStack, setEvent, toHtmlString
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

modifier

public Unregisterable modifier
The modifier to remove with this action

Constructor Detail

RemoveModifier

public RemoveModifier(TriggeredEvent event,
                      Unregisterable modifier)
Creates a new instance of RemoveModifier

Parameters:
event - the event attached to this ability.
modifier -
Method Detail

removeFromManager

public void removeFromManager()
Description copied from interface: Unregisterable
Remove from the event manager this listener.

Specified by:
removeFromManager in interface Unregisterable
Overrides:
removeFromManager in class Ability

optimizeRegisterToManager

public void optimizeRegisterToManager()
Description copied from class: Ability
Register this abilty to manager trying to append test on existing ability with same effects.

Overrides:
optimizeRegisterToManager in class Ability

equals

public boolean equals(ContextEventListener thisContext,
                      Ability ability,
                      ContextEventListener context)
Description copied from class: Ability
Compare two abilities the specified ability to the TBZ.

Overrides:
equals in class Ability
Parameters:
thisContext - the attached context of this ability
ability - the ability to add
context - the attached context of given ability
Returns:
true if the abilities are functionnaly equal in this context.

hashCode

public int hashCode()
Overrides:
hashCode in class Ability

getCard

public MCard getCard()
Description copied from class: Ability
Return card where is this ability. As default, it return null.

Specified by:
getCard in interface Unregisterable
Overrides:
getCard in class AbstractAbility
Returns:
true card where is this ability

toString

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

triggerIt

public boolean triggerIt(ContextEventListener context)
Description copied from class: Ability
called when this ability is going to be triggered This method would add this ability to the triggered zone, or perform another play action

Overrides:
triggerIt in class Ability
Parameters:
context - the context needed by event activated
Returns:
true if this ability has been added to the triggered buffer zone, return false otherwise

getLog

public java.lang.String getLog(ContextEventListener context)
Description copied from class: Ability
Return a String identifying this ability with the name and/or card name.

Specified by:
getLog in class Ability
Parameters:
context - the current context of this ability.
Returns:
a String identifying this ability with the name and/or card name.

getAbilityTitle

public java.lang.String getAbilityTitle()
Description copied from class: Ability
Return ability html title. Type of ability and a few other information

Overrides:
getAbilityTitle in class Ability
Returns:
ability html title. Type of ability and a few other information


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