net.sf.magicproject.clickable.ability
Class DetachmentAbility

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

public class DetachmentAbility
extends AbstractAbility

Author:
Fabrice Daugan

Field Summary
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Constructor Summary
DetachmentAbility(MEventListener event, MCard from, MCard to, Test attachmentTest)
          Creates a new instance of DetachmentAbility
 
Method Summary
 Ability clone(MCard container)
          return a copy of this ability
TODO remove param container since it is not used in this constructor As default, return null
 java.lang.String getAbilityTitle()
          Return ability html title.
 MCard getAttachedCard()
          Returns the attached card.
 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.
 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, equals, eventComing, getCardCopy, getController, getName, getPictureName, getTargetable, getTriggeredClone, getTriggeredCloneChoice, hashCode, hasHighPriority, isAutoResolve, isHidden, isPlayAsSpell, manaNeeded, optimizeRegisterToManager, registerToManager, removeFromManager, resolveStack, setEvent, toHtmlString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DetachmentAbility

public DetachmentAbility(MEventListener event,
                         MCard from,
                         MCard to,
                         Test attachmentTest)
Creates a new instance of DetachmentAbility

Parameters:
event - the event attached to this ability.
from - the card is to going to be attached.
to - the card is to going to be attached to.
attachmentTest - the attachement condition.
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
Overrides:
getCard in class AbstractAbility
Returns:
true card where is this ability

clone

public Ability clone(MCard container)
Description copied from class: Ability
return a copy of this ability
TODO remove param container since it is not used in this constructor As default, return null

Overrides:
clone in class Ability
Parameters:
container - is not used here
Returns:
copy of this 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

getAttachedCard

public MCard getAttachedCard()
Returns the attached card.

Returns:
the attached card.


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