|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.stack.ActionManager
public class ActionManager
The most important class of this application, and also the hardest to understand. This manager scheduls the actions handlers and the ability stack process.
Field Summary | |
---|---|
boolean |
advancedEffectMode
Is the advanced mode is used there for effects part. |
boolean |
advancedMode
Is the advanced mode is used there for cost part. |
Ability |
currentAbility
the current ability in the stack |
MAction |
currentAction
the active action managing the next player action |
int |
currentIdAction
The index of current action |
static int |
HANDLER_AD_REPLAY
The final handler : replay. |
static int |
HANDLER_INITIALIZATION
The first handler : initialization. |
int |
hop
like M68k processor bra instruction, indicates the jump to do to go to the next action. |
int |
idHandler
Values are : HANDLER_INITIALIZATION HANDLER_AD_SERIALIZATION HANDLER_AD_PREPARE_REPLAY HANDLER_AD_REPLAY HANDLER_PLAY_INIT HANDLER_MIDDLE HANDLER_EFFECTS |
int |
loopingIndex
This tag indicate the index of current action using a 'for' or 'while' instruction, generating several events. |
int[] |
requiredMana
Additional required mana. |
boolean |
waitingOnMiddle
Are we waiting for triggered/activated choice |
Method Summary | |
---|---|
MAction[] |
actionList()
Action/Effect list. |
boolean |
clickOn(Ability ability)
Called to specify the player choice for the current action |
boolean |
clickOn(JChoosenAction action)
Called to specify the player choice for the current action. |
boolean |
clickOn(Mana mana)
Called to specify the player choice for the current action |
boolean |
clickOn(MCard card)
Called to specify the player choice for the current action |
boolean |
clickOn(Player player)
Called to specify the player choice for the current action |
boolean |
clickOn(TriggeredCard triggeredCard)
Called to specify the player choice for the current action |
void |
completeChoosenAction(boolean unitaryCompleted)
Complete the current action. |
ContextEventListener |
getAbilityContext()
Return the current ability's context. |
ActionContextWrapper |
getActionContext()
Returns the context associated to the current action id. |
ActionContextWrapper |
getActionContext(int contextId)
Returns the context associated to the specified action id. |
ActionContextWrapper |
getActionContextNull()
Returns the context associated to the specified action id. |
ActionContextWrapper[] |
getAllActionContexts()
Returns the whole action contexts of current step : cost OR effect. |
ActionContextWrapper[] |
getTotalActionContexts()
Returns the whole action contexts : cost AND effect. |
void |
manualSkip()
Send the message "manualSkip" to the active action of play. |
void |
reactivate()
Reactivate the current action |
void |
setHop(int hop)
Set the jump to do for the next action. |
void |
setRepeat(int nbNextAction)
Will repeat the next action nbNextAction times |
void |
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. |
void |
succeedClickOn(JChoosenAction action)
This function should be called by the 'clickOn' caller in case of the specified player has been handled during the checking validity of this click in the clickOn(JChoosenAction) function. |
void |
succeedClickOn(Mana mana)
This function should be called by the 'clickOn' caller in case of the specified mana has been handled during the checking validity of this click in the clickOn(MMana) function. |
void |
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(Card) function. |
void |
succeedClickOn(Player player)
This function should be called by the 'clickOn' caller in case of the specified player has been handled during the checking validity of this click in the clickOn(Player) function. |
void |
succeedClickOn(TriggeredCard card)
This function should be called by the 'clickOn' caller in case of the specified triggered card has been handled during the checking validity of this click in the clickOn(MTriggeredCard) function. |
void |
updateRequiredMana(int[] requiredMana)
Update the given required mana with the global required mana. |
void |
updateRequiredMana(Operation op,
int reg,
int value)
Update the required mana of current ability. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int hop
public Ability currentAbility
public MAction currentAction
public int loopingIndex
public int currentIdAction
public boolean waitingOnMiddle
public int idHandler
public static final int HANDLER_INITIALIZATION
public static final int HANDLER_AD_REPLAY
public boolean advancedMode
public boolean advancedEffectMode
public final int[] requiredMana
Method Detail |
---|
public MAction[] actionList()
public ContextEventListener getAbilityContext()
public void manualSkip()
public void setRepeat(int nbNextAction)
nbNextAction
times
nbNextAction
- is the times that the next action will be repeatedpublic ActionContextWrapper getActionContextNull()
public ActionContextWrapper getActionContext(int contextId)
contextId
- the requestion acion id.
public ActionContextWrapper getActionContext()
public ActionContextWrapper[] getAllActionContexts()
getAllActionContexts()
public ActionContextWrapper[] getTotalActionContexts()
getAllActionContexts()
public void setHop(int hop)
hop
- the jump to do for the next action.public boolean clickOn(MCard card)
card
- the clicked card by the active player for the current action
public boolean clickOn(Player player)
player
- the clicked player by the active player for the current action
public boolean clickOn(TriggeredCard triggeredCard)
triggeredCard
- the clicked triggered card by the active player for the current
action
public boolean clickOn(Ability ability)
ability
- the clicked ability by the active player for the current action
public boolean clickOn(Mana mana)
mana
- the clicked mana by the active player for the current action
public boolean clickOn(JChoosenAction action)
action
- the clicked action by the active player for the current action
public void succeedClickOn(MCard card)
clickOn(Card)
function.
card
- the card that was clicked and successfuly handled by the
clickOn(Card)
function.clickOn(MCard)
public void succeedClickOn(Ability ability)
clickOn(Ability)
function.
ability
- the ability that was clicked and successfuly handled by the
clickOn(Ability)
function.clickOn(Ability)
public void succeedClickOn(TriggeredCard card)
clickOn(MTriggeredCard)
function.
card
- the triggered card that was clicked and successfuly handled by the
clickOn(MTriggeredCard)
function.clickOn(TriggeredCard)
public void succeedClickOn(Mana mana)
clickOn(MMana)
function.
mana
- the mana that was clicked and successfuly handled by the
clickOn(MMana)
function.clickOn(Mana)
public void succeedClickOn(Player player)
clickOn(Player)
function.
player
- the player that was clicked and successfuly handled by the
clickOn(Player)
function.clickOn(Player)
public void succeedClickOn(JChoosenAction action)
clickOn(JChoosenAction)
function.
action
- the action that was clicked and successfuly handled by the
clickOn(JChoosenAction)
function.clickOn(JChoosenAction)
public void completeChoosenAction(boolean unitaryCompleted)
unitaryCompleted
- is this action is completed as many times as required?public void reactivate()
public void updateRequiredMana(Operation op, int reg, int value)
op
- the operation to apply to the required mana.reg
- the register index to updatevalue
- the value to update.public void updateRequiredMana(int[] requiredMana)
requiredMana
- the required mana to update.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |