net.sf.magicproject.action
Class WaitActivatedChoice

java.lang.Object
  extended by net.sf.magicproject.action.MAction
      extended by net.sf.magicproject.action.WaitActivatedChoice
All Implemented Interfaces:
Waiting, WaitingAbility, WaitingCard

public final class WaitActivatedChoice
extends MAction
implements WaitingCard, WaitingAbility

Since:
0.60
Author:
Fabrice Daugan

Field Summary
static boolean opponentResponse
          If true, player can response to opponent effects
 
Method Summary
 java.util.List<Ability> abilitiesOf(MCard card)
          Return activated abilities of the specified card.
 java.util.List<Ability> advancedAbilitiesOf(MCard card)
          Return activated advanced abilities of the specified card.
 boolean clickOn(Ability ability)
          Called to specify the triggered card chosen for the current action by the handed player
 boolean clickOn(MCard card)
          Called to specify the card chosen for the current action by the handed player
 void finished()
          Called when this action is finished (aborted or completed).
 Actiontype getIdAction()
          Return the index of this action.
static WaitActivatedChoice getInstance()
          Return the unique instance of this class.
 boolean manualSkip()
          Called by the handed player when he/she wants to skip/abort this action.
 boolean play(ContextEventListener context, Ability ability)
          Generate event associated to this action.
 boolean succeedClickOn(Ability ability)
          This function should be called by the 'clickOn' caller in case of the specified ability has been handled during the checking validity of this click in the clickOn(Ability) function.
 boolean succeedClickOn(MCard card)
          This function should be called by the 'clickOn' caller in case of the specified card has been handled during the checking validity of this click in the clickOn(MCard) function.
 java.lang.String toString(Ability ability)
          return the string representation of this action
 
Methods inherited from class net.sf.magicproject.action.MAction
equal, getActionName, manaNeeded, parseTest, toHtmlString, toHtmlString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

opponentResponse

public static boolean opponentResponse
If true, player can response to opponent effects

Method Detail

play

public boolean play(ContextEventListener context,
                    Ability ability)
Generate event associated to this action. Only one or several events are generated and may be collected by event listeners. Then play this action

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - is the context attached to this action.
Returns:
true if the stack resolution can continue. False if the stack resolution is broken.

clickOn

public boolean clickOn(MCard card)
Description copied from interface: WaitingCard
Called to specify the card chosen for the current action by the handed player

Specified by:
clickOn in interface WaitingCard
Parameters:
card - the clicked card by the handed player for the current action
Returns:
true if this click has been managed. Return false if this click has been ignored

clickOn

public boolean clickOn(Ability ability)
Description copied from interface: WaitingAbility
Called to specify the triggered card chosen for the current action by the handed player

Specified by:
clickOn in interface WaitingAbility
Parameters:
ability - the clicked card by the handed player for the current action
Returns:
true if this click has been managed. Return false if this click has been ignored

succeedClickOn

public boolean succeedClickOn(MCard card)
Description copied from interface: WaitingCard
This function should be called by the 'clickOn' caller in case of the specified card has been handled during the checking validity of this click in the clickOn(MCard) function.

Specified by:
succeedClickOn in interface WaitingCard
Parameters:
card - the card that was clicked and successfuly handled by the clickOn(MCard) function.
Returns:
true if this action is completed

succeedClickOn

public boolean succeedClickOn(Ability ability)
Description copied from interface: WaitingAbility
This function should be called by the 'clickOn' caller in case of the specified ability has been handled during the checking validity of this click in the clickOn(Ability) function.

Specified by:
succeedClickOn in interface WaitingAbility
Parameters:
ability - the ability that was clicked and successfuly handled by the clickOn(Ability) function.
Returns:
true if this action is completed
See Also:
WaitingAbility.clickOn(Ability)

getIdAction

public Actiontype getIdAction()
Description copied from class: MAction
Return the index of this action. As default, this is a zero id

Specified by:
getIdAction in class MAction
Returns:
the index of this action.
See Also:
Actiontype

manualSkip

public boolean manualSkip()
Description copied from interface: Waiting
Called by the handed player when he/she wants to skip/abort this action. No stack operation should be done here.

Specified by:
manualSkip in interface Waiting
Specified by:
manualSkip in interface WaitingAbility
Specified by:
manualSkip in interface WaitingCard
Returns:
true if this action allow the skip/cancel.

finished

public void finished()
Description copied from interface: Waiting
Called when this action is finished (aborted or completed). No stack operation should be done here.

Specified by:
finished in interface Waiting
Specified by:
finished in interface WaitingAbility
Specified by:
finished in interface WaitingCard

abilitiesOf

public java.util.List<Ability> abilitiesOf(MCard card)
Description copied from interface: WaitingAbility
Return activated abilities of the specified card.

Specified by:
abilitiesOf in interface WaitingAbility
Parameters:
card - the requesting card the abilities will be listed from.
Returns:
activated abilities of the specified card.

advancedAbilitiesOf

public java.util.List<Ability> advancedAbilitiesOf(MCard card)
Description copied from interface: WaitingAbility
Return activated advanced abilities of the specified card.

Specified by:
advancedAbilitiesOf in interface WaitingAbility
Parameters:
card - the requesting card the abilities will be listed from.
Returns:
activated advanced abilities of the specified card.

toString

public java.lang.String toString(Ability ability)
return the string representation of this action

Specified by:
toString in class MAction
Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
Returns:
the string representation of this action
See Also:
Object.toString()

getInstance

public static WaitActivatedChoice getInstance()
Return the unique instance of this class.

Returns:
the unique instance of this class.


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