|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.event.MEventListener net.sf.magicproject.event.TriggeredEvent net.sf.magicproject.event.AssignedDamage
public class AssignedDamage
Field Summary | |
---|---|
static Event |
EVENT
The event type. |
Fields inherited from class net.sf.magicproject.event.TriggeredEvent |
---|
replacement |
Fields inherited from class net.sf.magicproject.event.MEventListener |
---|
CAN_I_CAST_ABILITIES, card, REPLACEMENT_ABILITIES, test, TRIGGRED_ABILITIES |
Constructor Summary | |
---|---|
AssignedDamage(java.io.InputStream inputFile,
MCard card)
Create an instance of MEventDamaged by reading a file Offset's file must pointing on the first byte of this event Structure of InputStream : Data[size] [super] damage type[Expression] test source[Test] test destination[Test] |
Method Summary | |
---|---|
MEventListener |
clone(MCard card)
Return a copy of this with the specified owner |
static void |
dispatchEvent(MCard source,
Targetable target,
int damageNumber,
int damageType)
Dispatch this event to all active event listeners able to understand this event. |
Event |
getIdEvent()
Return the idEvent of this event |
boolean |
isMatching(MCard source,
Targetable destination,
int damageNumber,
int damageType,
Ability ability)
Tell if the current event matches with this event. |
static boolean |
tryAction(MCard source,
Targetable target,
int damageNumber,
int damageType)
Dispatch this event to replacement abilites only. |
Methods inherited from class net.sf.magicproject.event.TriggeredEvent |
---|
isActivated, isTriggered, registerToManager, removeFromManager, toHtmlString |
Methods inherited from class net.sf.magicproject.event.MEventListener |
---|
appendOr, getIdPlace, isWellPlaced, isWellPlaced, reCheck, reCheck, reset |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Event EVENT
Constructor Detail |
---|
public AssignedDamage(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 streamMethod Detail |
---|
public MEventListener clone(MCard card)
MEventListener
clone
in class TriggeredEvent
card
- is the card of the ability of this event
public boolean isMatching(MCard source, Targetable destination, int damageNumber, int damageType, Ability ability)
source
- the source of damagedestination
- the damaged player/carddamageNumber
- the amount of damage to dodamageType
- the type of this damage (prevent/dealt, lose life or gain life).ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.
public static boolean tryAction(MCard source, Targetable target, int damageNumber, int damageType)
false
value,
the caller should not call any stack resolution since activated abilities
are being played.
source
- the source of damagetarget
- the damaged player/carddamageNumber
- the amount of damage to dodamageType
- the type of this damage (prevent/dealt, lose life or gain life).
public static void dispatchEvent(MCard source, Targetable target, int damageNumber, int damageType)
this
and other multiple event listeners. For each event listeners having
responded they have been activated, the corresponding ability is added to
the triggered buffer zone of player owning this ability
source
- the source of damagetarget
- the damaged player/carddamageNumber
- the amount of damage to dodamageType
- the type of this damage (prevent/dealt, lose life or gain life).isMatching(MCard, Targetable, int, int, Ability)
public final Event getIdEvent()
MEventListener
getIdEvent
in class TriggeredEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |