net.sf.magicproject.clickable.ability
Class RefreshAbility

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.RefreshAbility
All Implemented Interfaces:
Unregisterable, ResolveStackHandler

public class RefreshAbility
extends AbstractAbility

Author:
Fabrice Daugan

Field Summary
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Constructor Summary
RefreshAbility(TriggeredEvent event, RefreshModifier refreshAction, MCard trigger)
          Creates a new instance of RefreshAbility
 
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.
 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, removeFromManager, resolveStack, setEvent, toHtmlString
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RefreshAbility

public RefreshAbility(TriggeredEvent event,
                      RefreshModifier refreshAction,
                      MCard trigger)
Creates a new instance of RefreshAbility

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

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

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

toString

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

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.

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

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.