|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.action.MAction net.sf.magicproject.action.UserAction net.sf.magicproject.action.PayMana
public class PayMana
Used to pay mana, remove directly mana from the mana pool
Actiontype.PAY_MANA
Field Summary | |
---|---|
TestOn |
controller
The player paying this mana |
static int |
thresholdColored
The maximum number of mana symbols displayed in context menu. |
static boolean |
useMana
If true, mana operation are nor ignored. |
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 |
choose(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
No generated event. |
boolean |
clickOn(Ability ability)
Called to specify the triggered card chosen for the current action by the handed player |
static void |
clickOn(java.io.InputStream input)
This method is invoked when opponent has clicked on manas. this call should be done from the net.sf.magicproject.network listener |
boolean |
clickOn(Mana mana)
Called to specify the mana component chosen for the current action by the handed player |
void |
disactivate(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
No generated event. |
void |
finished()
Called when this action is finished (aborted or completed). |
Actiontype |
getIdAction()
Return the index of this action. |
boolean |
init(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
No generated event. |
int[] |
manaNeeded(Ability ability,
ContextEventListener context)
Return the amount of mana needed (constant part only) to play this ability As default, we return an empty number for all manas. |
boolean |
manualSkip()
Called by the handed player when he/she wants to skip/abort this action. |
boolean |
replay(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
Generate event associated to this action. |
void |
rollback(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
No generated event. |
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(Mana mana)
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(Mana) function. |
java.lang.String |
toHtmlString(Ability ability,
ContextEventListener context)
Return the HTML code representing this action. |
java.lang.String |
toHtmlString(Ability ability,
ContextEventListener context,
ActionContextWrapper actionContext)
Return the HTML code representing this action. |
static java.lang.String |
toHtmlString(int[] manaPool)
Return Html string corresponding to the given mana pool. |
java.lang.String |
toString(Ability ability)
String representation of this action. |
Methods inherited from class net.sf.magicproject.action.UserAction |
---|
getActionName, toHtmlString |
Methods inherited from class net.sf.magicproject.action.MAction |
---|
equal, parseTest, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public TestOn controller
public static boolean useMana
public static int thresholdColored
Method Detail |
---|
public Actiontype getIdAction()
MAction
getIdAction
in class UserAction
Actiontype
public int[] manaNeeded(Ability ability, ContextEventListener context)
MAction
manaNeeded
in class UserAction
ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.context
- the context of playing ability.
public boolean init(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
InitAction
init
in interface InitAction
actionContext
- the context containing data saved by this action during the
'choose" proceess.context
- is the context attached to this action.ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.
public void disactivate(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
disactivate
in interface ChoosenAction
actionContext
- the context containing data saved by this action during the
'choose" proceess.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.public void rollback(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
rollback
in interface RollBackAction
actionContext
- the context containing data saved by this action during the
'choose" proceess.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.public void finished()
finished
in interface Waiting
finished
in interface WaitingAbility
finished
in interface WaitingMana
public boolean choose(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
ChoosenAction
choose
in interface ChoosenAction
actionContext
- the context containing data saved by this action during the
'choose" proceess.context
- is the context attached to this action.ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.
public boolean replay(ActionContextWrapper actionContext, ContextEventListener context, Ability ability)
ChoosenAction
replay
in interface ChoosenAction
replay
in interface InitAction
replay
in interface Replayable
actionContext
- the context containing data saved by this action during the
'choose" proceess.context
- is the context attached to this action.ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.
public boolean manualSkip()
Waiting
manualSkip
in interface Waiting
manualSkip
in interface WaitingAbility
manualSkip
in interface WaitingMana
public boolean clickOn(Mana mana)
WaitingMana
clickOn
in interface WaitingMana
mana
- the clicked mana component by the handed player for the current
action
public boolean succeedClickOn(Mana mana)
WaitingMana
clickOn(Mana)
function.
succeedClickOn
in interface WaitingMana
mana
- the mana that was clicked and successfuly handled by the
clickOn(Card)
function.
public static void clickOn(java.io.InputStream input) throws java.io.IOException
input
- input stream of our net.sf.magicproject.network connection
java.io.IOException
- if error occurred when reading the messagepublic java.lang.String toHtmlString(Ability ability, ContextEventListener context, ActionContextWrapper actionContext)
ChoosenAction
toHtmlString
in interface ChoosenAction
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.actionContext
- the context of this action.
public java.lang.String toHtmlString(Ability ability, ContextEventListener context)
MAction
toHtmlString
in class UserAction
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.
MAction.toString(Ability)
,
MAction.toHtmlString(Ability, int, ContextEventListener)
public java.lang.String toString(Ability ability)
MAction
toString
in class UserAction
ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.
Object.toString()
public boolean clickOn(Ability ability)
WaitingAbility
clickOn
in interface WaitingAbility
ability
- the clicked card by the handed player for the current action
public java.util.List<Ability> abilitiesOf(MCard card)
WaitingAbility
abilitiesOf
in interface WaitingAbility
card
- the requesting card the abilities will be listed from.
public java.util.List<Ability> advancedAbilitiesOf(MCard card)
WaitingAbility
advancedAbilitiesOf
in interface WaitingAbility
card
- the requesting card the abilities will be listed from.
public boolean succeedClickOn(Ability ability)
WaitingAbility
clickOn(Ability)
function.
succeedClickOn
in interface WaitingAbility
ability
- the ability that was clicked and successfuly handled by the
clickOn(Ability)
function.
WaitingAbility.clickOn(Ability)
public static java.lang.String toHtmlString(int[] manaPool)
{color} x {amount}
will be used. If
the given code is empty the {0}
value will be returned.
manaPool
- the amount of mana to pay
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |