net.sf.magicproject.action
Class WaitChoosenActionChoice

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

public final class WaitChoosenActionChoice
extends MAction
implements WaitingAction, WaitingAbility

Since:
0.86
Author:
Fabrice Daugan

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(JChoosenAction action)
          Called to specify the triggered 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 WaitChoosenActionChoice 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 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(JChoosenAction action)
          This function should be called by the 'clickOn' caller in case of the specified action has been handled during the checking validity of this click in the clickOn(JChoosenAction) function.
 java.lang.String toString(Ability ability)
          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
 

Method Detail

clickOn

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

Specified by:
clickOn in interface WaitingAction
Parameters:
action - the clicked 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(JChoosenAction action)
Description copied from interface: WaitingAction
This function should be called by the 'clickOn' caller in case of the specified action has been handled during the checking validity of this click in the clickOn(JChoosenAction) function.

Specified by:
succeedClickOn in interface WaitingAction
Parameters:
action - the action that was clicked and successfuly handled by the clickOn(JChoosenAction) 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 WaitingAction
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 WaitingAction

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)
Description copied from class: MAction
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:
action name.
See Also:
Object.toString()

getInstance

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

Returns:
the unique instance of this class.


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