net.sf.magicproject.event
Class FacedUp

java.lang.Object
  extended by net.sf.magicproject.event.MEventListener
      extended by net.sf.magicproject.event.TriggeredEvent
          extended by net.sf.magicproject.event.FacedUp
All Implemented Interfaces:
RegisterableEvent

public class FacedUp
extends TriggeredEvent

Event generated when a card is faced up.

Since:
0.90
Author:
Hoani CROSS

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
FacedUp(int idZone, Test test, MCard card)
          Creates a new instance of FacedUp specifying all attributes of this class.
 
Method Summary
 MEventListener appendOr(MEventListener other)
          Create and returns an union of this event and the specified one.
 MEventListener clone(MCard card)
          Return a copy of this with the specified owner
static void dispatchEvent(MCard facedUpCard)
          Dispatch this event to all active event listeners able to understand this event.
 Event getIdEvent()
          Return the idEvent of this event
 boolean isMatching(Ability ability, MCard facedUpCard)
          Tell if the current event matches with this event.
 
Methods inherited from class net.sf.magicproject.event.TriggeredEvent
isActivated, isTriggered, registerToManager, removeFromManager, toHtmlString
 
Methods inherited from class net.sf.magicproject.event.MEventListener
getIdPlace, isWellPlaced, isWellPlaced, reCheck, reCheck, reset
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT

public static final Event EVENT
The event type.

Constructor Detail

FacedUp

public FacedUp(int idZone,
               Test test,
               MCard card)
Creates a new instance of FacedUp specifying all attributes of this class. All parameters are copied, not cloned. So this new object shares the card and the specified codes

Parameters:
idZone - the place constraint to activate this event
test - the test of this event
card - is the card owning this card
Method Detail

clone

public MEventListener clone(MCard card)
Return a copy of this with the specified owner

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

isMatching

public boolean isMatching(Ability ability,
                          MCard facedUpCard)
Tell if the current event matches with this event. If there is an additional code to check, it'would be checked if the main event matches with the main event

Parameters:
facedUpCard - the became taped/untapped
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
Returns:
true if the current event match with this event

dispatchEvent

public static void dispatchEvent(MCard facedUpCard)
Dispatch this event to all active event listeners able to understand this event. The listening events able to understand this event are 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

Parameters:
facedUpCard - the became taped/untapped
See Also:
isMatching(Ability, MCard)

getIdEvent

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

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

appendOr

public MEventListener appendOr(MEventListener other)
Create and returns an union of this event and the specified one. Both event must have the same type. Test(s) and events attributes may be groupped depending instance of this event. If no possible append is possible null is returned.

Overrides:
appendOr in class MEventListener
Parameters:
other - the event to append with 'or' operator.
Returns:
a new event reprensenting 'this' or 'other'


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