|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.clickable.ability.Ability
public abstract class Ability
An ability contains a cost part and an effect part. Each ability is associated to an event conditionning it's activation.
Field Summary | |
---|---|
Optimization |
optimizer
The optimizer to use to manage the 'add' method to the TBZ |
Priority |
priority
The resolution selector choose the right abstract zone where an hidden ability would be added. |
Method Summary | |
---|---|
abstract MAction[] |
actionList()
Return list of actions to play to cast this ability |
void |
addLinkedAbility(Ability ability)
Add a linked ability. |
boolean |
checkObjectActions()
Checks too the other actions requiring a particular state, such as the presence of an object. |
boolean |
checkTargetActions()
Verify in the 'cost' part there is no target action may cause abortion of this ability. |
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 |
abstract MAction[] |
effectList()
Return list of actions effects of this ability |
boolean |
equals(ContextEventListener thisContext,
Ability ability,
ContextEventListener context)
Compare two abilities the specified ability to the TBZ. |
MEventListener |
eventComing()
Return matched to activate this ability matched to activate this ability. |
java.lang.String |
getAbilityTitle()
Return ability html title. |
abstract MCard |
getCard()
Return card where is this ability. |
CardCopy |
getCardCopy()
Return a card representing this ability. |
Player |
getController()
Return the controller of this ability |
abstract java.lang.String |
getLog(ContextEventListener context)
Return a String identifying this ability with the name and/or card name. |
java.lang.String |
getName()
Return the name of this ability |
java.lang.String |
getPictureName()
Return the picture name associated to this ability. |
Targetable |
getTargetable()
Return card where is this ability |
TriggeredCard |
getTriggeredClone(ContextEventListener context)
Return a MTriggeredCard representing this ability. |
TriggeredCardChoice |
getTriggeredCloneChoice(ContextEventListener context)
Return a MTriggeredCard representing this ability. |
int |
hashCode()
|
boolean |
hasHighPriority()
Indicates wether this ability is choosen in priority to the others without this tag. |
boolean |
isAutoResolve()
Indicates if this ability is immediatly after it has been added to the stack. |
boolean |
isHidden()
Indicates if this ability is immediatly after it has been added to the stack (like isAutoResolve), and if no information is displayed or prompted to the users. |
abstract boolean |
isMatching()
compare the current event to the event activating this ability. |
boolean |
isPlayAsSpell()
Is this ability is played as a spell. |
int[] |
manaNeeded(ContextEventListener context)
return the amount of mana needed (constant part only) to play this ability |
void |
optimizeRegisterToManager()
Register this abilty to manager trying to append test on existing ability with same effects. |
boolean |
recheckTargets()
Is this ability contains targeting action. |
void |
registerToManager()
Add this ability to the looked for events. |
void |
removeFromManager()
Remove from the event manager this listener. |
void |
resolveStack()
called when the stack is resolving |
void |
setEvent(MEventListener event)
Set the new event for this ability. |
java.lang.String |
toHtmlString(ContextEventListener context)
Return the HTML code representing this ability. |
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 java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Optimization optimizer
public Priority priority
Method Detail |
---|
public void optimizeRegisterToManager()
public java.lang.String getName()
public boolean checkTargetActions()
public boolean checkObjectActions()
public boolean recheckTargets()
public abstract MCard getCard()
getCard
in interface Unregisterable
public Targetable getTargetable()
public boolean isAutoResolve()
ResolveStackHandler
isAutoResolve
in interface ResolveStackHandler
public boolean isHidden()
ResolveStackHandler
isHidden
in interface ResolveStackHandler
ResolveStackHandler.isAutoResolve()
public boolean hasHighPriority()
public abstract boolean isMatching()
public CardCopy getCardCopy()
public java.lang.String getPictureName()
null
if no picture is used with this ability.
public int[] manaNeeded(ContextEventListener context)
context
- the current context of this ability.
public abstract MAction[] actionList()
public abstract MAction[] effectList()
public MEventListener eventComing()
public void setEvent(MEventListener event)
event
- the new event for this ability.public Ability clone(MCard container)
container
- is not used here
public TriggeredCard getTriggeredClone(ContextEventListener context)
context
- the attached context of this ability
public TriggeredCardChoice getTriggeredCloneChoice(ContextEventListener context)
context
- the attached context of this ability
public void resolveStack()
ResolveStackHandler
resolveStack
in interface ResolveStackHandler
StackManager.resolveStack()
public boolean triggerIt(ContextEventListener context)
context
- the context needed by event activated
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHtmlString(ContextEventListener context)
context
- the context needed by event activated
public java.lang.String getAbilityTitle()
public void removeFromManager()
Unregisterable
removeFromManager
in interface Unregisterable
public void registerToManager()
public Player getController()
public final void addLinkedAbility(Ability ability)
ability
- a linked ability to add.public boolean equals(ContextEventListener thisContext, Ability ability, ContextEventListener context)
thisContext
- the attached context of this abilityability
- the ability to addcontext
- the attached context of given ability
public int hashCode()
hashCode
in class java.lang.Object
public boolean isPlayAsSpell()
true
if this ability is played as a spell.public abstract java.lang.String getLog(ContextEventListener context)
context
- the current context of this ability.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |