net.sf.magicproject.clickable.ability
Class AbstractAbility

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

public abstract class AbstractAbility
extends Ability

Author:
Fabrice Daugan

Field Summary
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Constructor Summary
AbstractAbility(java.lang.String name, MEventListener event, java.lang.String pictureName, java.util.List<Ability> linkedAbilities, TrueFalseAuto playAsSpell)
          Creates a new instance of AbstractAbility
 
Method Summary
 MAction[] actionList()
          Return list of actions to play to cast this ability
 MAction[] effectList()
          Return list of actions effects of this ability
 MCard getCard()
          Return card where is this ability.
 boolean isMatching()
          compare the current event to the event activating this ability.
 boolean recheckTargets()
          Is this ability contains targeting action.
 
Methods inherited from class net.sf.magicproject.clickable.ability.Ability
addLinkedAbility, checkObjectActions, checkTargetActions, clone, equals, eventComing, getAbilityTitle, getCardCopy, getController, getLog, getName, getPictureName, getTargetable, getTriggeredClone, getTriggeredCloneChoice, hashCode, hasHighPriority, isAutoResolve, isHidden, isPlayAsSpell, manaNeeded, optimizeRegisterToManager, registerToManager, removeFromManager, resolveStack, setEvent, toHtmlString, toString, triggerIt
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAbility

public AbstractAbility(java.lang.String name,
                       MEventListener event,
                       java.lang.String pictureName,
                       java.util.List<Ability> linkedAbilities,
                       TrueFalseAuto playAsSpell)
Creates a new instance of AbstractAbility

Parameters:
name - the ability name
event - the event attached to this ability.
pictureName - the optional picture used to display this ability.
linkedAbilities - the linked abilities. May be null.
playAsSpell - play-as-spell.
Method Detail

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
Specified by:
getCard in class Ability
Returns:
true card where is this ability

isMatching

public boolean isMatching()
Description copied from class: Ability
compare the current event to the event activating this ability. If matching, verify that there enougth mana in the player's mana pool

Specified by:
isMatching in class Ability
Returns:
true if this ability can be played responding the current event

actionList

public MAction[] actionList()
Description copied from class: Ability
Return list of actions to play to cast this ability

Specified by:
actionList in class Ability
Returns:
list of actions to play to cast this ability

effectList

public MAction[] effectList()
Description copied from class: Ability
Return list of actions effects of this ability

Specified by:
effectList in class Ability
Returns:
list of actions effects of this ability

recheckTargets

public boolean recheckTargets()
Description copied from class: Ability
Is this ability contains targeting action.

Overrides:
recheckTargets in class Ability
Returns:
true if this ability contains targeting action.


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