net.sf.magicproject.event
Class TriggeredEvent

java.lang.Object
  extended by net.sf.magicproject.event.MEventListener
      extended by net.sf.magicproject.event.TriggeredEvent
All Implemented Interfaces:
RegisterableEvent
Direct Known Subclasses:
ArrangedZone, AssignedDamage, AttachedEvent, BecomeTapped, BecomeUnTapped, BeforePhase, BeginningPhase, Casting, DeclaredAttacking, DeclaredBlocking, Detached, EndOfPhase, FacedDown, FacedUp, GivenMana, LethalDamaged, LoseGame, ModifiedController, ModifiedIdCard, ModifiedIdColor, ModifiedOwner, ModifiedProperty, ModifiedPropertyIntersection, ModifiedRegister, MovedCard, Targeted, UncaughtException, UpdatedLife, UpdateToughness

public abstract class TriggeredEvent
extends MEventListener

MEventTriggered.java Created on 2 févr. 2004

Since:
0.54
Author:
Fabrice Daugan

Field Summary
static IntegerWrapper replacement
          The selected replacement ability to use
 
Fields inherited from class net.sf.magicproject.event.MEventListener
CAN_I_CAST_ABILITIES, card, REPLACEMENT_ABILITIES, test, TRIGGRED_ABILITIES
 
Constructor Summary
TriggeredEvent(java.io.InputStream inputFile, MCard card)
          Create an instance of MEventTriggered by reading a file Offset's file must pointing on the first byte of this event
Structure of InputStream : Data[size] idZone [1] test [...]
 
Method Summary
abstract  MEventListener clone(MCard card)
          Return a copy of this with the specified owner
abstract  Event getIdEvent()
          Return the idEvent of this event
 boolean isActivated()
          Indicates if this event corresponds to an activated ability
 boolean isTriggered()
          Indicates if this event corresponds to a triggered ability
 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
 java.lang.String toHtmlString(Ability ability, ContextEventListener context)
          Return the HTML code representing this ability.
 
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

replacement

public static IntegerWrapper replacement
The selected replacement ability to use

Constructor Detail

TriggeredEvent

public TriggeredEvent(java.io.InputStream inputFile,
                      MCard card)
               throws java.io.IOException
Create an instance of MEventTriggered by reading a file Offset's file must pointing on the first byte of this event

Parameters:
inputFile - is the file containing this event
card - is the card owning this event
Throws:
java.io.IOException - if error occured during the reading process from the specified input stream
Method Detail

clone

public abstract MEventListener clone(MCard card)
Description copied from class: MEventListener
Return a copy of this with the specified owner

Specified by:
clone in class MEventListener
Parameters:
card - is the card of the ability of this event
Returns:
copy of this event

getIdEvent

public abstract Event getIdEvent()
Description copied from class: MEventListener
Return the idEvent of this event

Specified by:
getIdEvent in class MEventListener
Returns:
the idEvent of this event

registerToManager

public void registerToManager(Ability ability)
Description copied from interface: RegisterableEvent
register this event to the event manager

Specified by:
registerToManager in interface RegisterableEvent
Specified by:
registerToManager in class MEventListener
Parameters:
ability - owning this event

removeFromManager

public void removeFromManager(Ability ability)
Description copied from interface: RegisterableEvent
remove from the manager this event if doesn't match with the new context

Specified by:
removeFromManager in interface RegisterableEvent
Specified by:
removeFromManager in class MEventListener
Parameters:
ability - owning this event

isActivated

public final boolean isActivated()
Description copied from class: MEventListener
Indicates if this event corresponds to an activated ability

Specified by:
isActivated in class MEventListener
Returns:
true if this event corresponds to an activated ability

isTriggered

public final boolean isTriggered()
Description copied from class: MEventListener
Indicates if this event corresponds to a triggered ability

Specified by:
isTriggered in class MEventListener
Returns:
true if this event corresponds to a triggered ability

toHtmlString

public java.lang.String toHtmlString(Ability ability,
                                     ContextEventListener context)
Description copied from class: MEventListener
Return the HTML code representing this ability.

Overrides:
toHtmlString in class MEventListener
Parameters:
ability - is the attached ability.
context - the context needed by event activated
Returns:
the HTML code representing this ability.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.