|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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 UserActionActiontype
public int[] manaNeeded(Ability ability,
ContextEventListener context)
MAction
manaNeeded in class UserActionability - 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 InitActionactionContext - 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 ChoosenActionactionContext - 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 RollBackActionactionContext - 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 Waitingfinished in interface WaitingAbilityfinished in interface WaitingMana
public boolean choose(ActionContextWrapper actionContext,
ContextEventListener context,
Ability ability)
ChoosenAction
choose in interface ChoosenActionactionContext - 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 ChoosenActionreplay in interface InitActionreplay in interface ReplayableactionContext - 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 WaitingmanualSkip in interface WaitingAbilitymanualSkip in interface WaitingManapublic boolean clickOn(Mana mana)
WaitingMana
clickOn in interface WaitingManamana - the clicked mana component by the handed player for the current
action
public boolean succeedClickOn(Mana mana)
WaitingManaclickOn(Mana) function.
succeedClickOn in interface WaitingManamana - 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 message
public java.lang.String toHtmlString(Ability ability,
ContextEventListener context,
ActionContextWrapper actionContext)
ChoosenAction
toHtmlString in interface ChoosenActionability - 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 UserActionability - 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 UserActionability - 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 WaitingAbilityability - the clicked card by the handed player for the current action
public java.util.List<Ability> abilitiesOf(MCard card)
WaitingAbility
abilitiesOf in interface WaitingAbilitycard - the requesting card the abilities will be listed from.
public java.util.List<Ability> advancedAbilitiesOf(MCard card)
WaitingAbility
advancedAbilitiesOf in interface WaitingAbilitycard - the requesting card the abilities will be listed from.
public boolean succeedClickOn(Ability ability)
WaitingAbilityclickOn(Ability) function.
succeedClickOn in interface WaitingAbilityability - 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 | |||||||||