|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.magicproject.event.MEventListener
net.sf.magicproject.event.CanICast
public class CanICast
| Field Summary |
|---|
| Fields inherited from class net.sf.magicproject.event.MEventListener |
|---|
CAN_I_CAST_ABILITIES, card, REPLACEMENT_ABILITIES, test, TRIGGRED_ABILITIES |
| Constructor Summary | |
|---|---|
CanICast(java.io.InputStream inputFile,
MCard card)
Create an instance of CanICast by reading a file Offset's file must pointing on the first byte of this event Structure of InputStream : Data[size] [super] idCard [Expression] |
|
| Method Summary | |
|---|---|
MEventListener |
clone(MCard card)
Return a copy of this with the specified owner |
static void |
dispatchEvent(int idActivePlayer,
java.util.List<Ability> res,
java.util.List<Ability> advRes)
Dispatch this event to all active event listener able to understand this event. |
static void |
dispatchManaAbilityEvent(int idActivePlayer,
java.util.List<Ability> res)
Dispatch this event to all active event listener able to understand this event. |
Event |
getIdEvent()
Return the idEvent of this event |
int |
getPlayableIdCard()
Return set of playable idCard |
boolean |
isActivated()
Indicates if this event corresponds to an activated ability |
boolean |
isMatching(Ability ability,
int idActivePlayer)
Tell if the current event matches with this event. |
boolean |
isMatchingManaAbility(Ability ability,
int idActivePlayer)
Tell if the current event matches with this event. |
boolean |
isTriggered()
Indicates if this event corresponds to a triggered ability |
boolean |
isWellPlaced()
Tell if the card is well placed for this event to be playable |
boolean |
isWellPlaced(int idZone)
Tell if the card is well placed for this event to be playable |
void |
registerToManager(Ability ability)
register this event to the event manager |
void |
removeFromManager(Ability ability)
remove from the manager this event if doesn't match with the new context |
boolean |
updateManaAbilityTag(MAction... actionList)
Iterate on given actions looking for a 'give mana' action. |
| Methods inherited from class net.sf.magicproject.event.MEventListener |
|---|
appendOr, getIdPlace, reCheck, reCheck, reset, toHtmlString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CanICast(java.io.InputStream inputFile,
MCard card)
throws java.io.IOException
inputFile - is the file containing this eventcard - is the card owning this event
java.io.IOException - if error occurred during the reading process from the specified
input stream| Method Detail |
|---|
public MEventListener clone(MCard card)
MEventListener
clone in class MEventListenercard - is the card of the ability of this event
public final boolean isActivated()
MEventListener
isActivated in class MEventListenerpublic final boolean isTriggered()
MEventListener
isTriggered in class MEventListenerpublic final void registerToManager(Ability ability)
RegisterableEvent
registerToManager in interface RegisterableEventregisterToManager in class MEventListenerability - owning this eventpublic final void removeFromManager(Ability ability)
RegisterableEvent
removeFromManager in interface RegisterableEventremoveFromManager in class MEventListenerability - owning this event
public boolean isMatching(Ability ability,
int idActivePlayer)
ability - is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.idActivePlayer - id of active player
public boolean isMatchingManaAbility(Ability ability,
int idActivePlayer)
ability - is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.idActivePlayer - id of active player
public boolean isWellPlaced()
MEventListener
isWellPlaced in class MEventListenerpublic boolean isWellPlaced(int idZone)
MEventListener
isWellPlaced in class MEventListeneridZone - the supposed zone where card is.
public static void dispatchEvent(int idActivePlayer,
java.util.List<Ability> res,
java.util.List<Ability> advRes)
this
and other multiple event listeners
idActivePlayer - id of active playerres - list in which playable abilities would be addedadvRes - list in which advanced playable abilities would be addedisMatching(Ability, int)
public static void dispatchManaAbilityEvent(int idActivePlayer,
java.util.List<Ability> res)
idActivePlayer - id of active playerres - list in which playable abilities would be addedisMatching(Ability, int)public boolean updateManaAbilityTag(MAction... actionList)
idCard of this event will be
replaced by IdTokens.MANA_ABILITY
actionList - list of actions
public int getPlayableIdCard()
public final Event getIdEvent()
MEventListener
getIdEvent in class MEventListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||