net.sf.magicproject.test
Enum TestOn

java.lang.Object
  extended by java.lang.Enum<TestOn>
      extended by net.sf.magicproject.test.TestOn
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<TestOn>

public enum TestOn
extends java.lang.Enum<TestOn>
implements java.io.Serializable

Author:
Fabrice Daugan

Enum Constant Summary
ATTACHED_TO
          The card to use for the test with 'attachedto' is the card the card owning the test is attached to.
ATTACHED_TO_CONTROLLER
          The controller of 'attachedto' to.
ATTACHED_TO_OF_TESTED
          The card to use for the test with 'tested.attachedto' is the card the 'tested' card is attached to.
ATTACHED_TO_OWNER
          The owner of 'attachedto' to.
CONTEXT_CARD_SHARE
          The Targetable cast to MCard object of this context without considering it's timstamp.
CONTEXT_CARD1
          The card to use for the test with 'context.card' is the first card saved in the context.
CONTEXT_CARD1_CONTROLLER
          The controller of the first card saved in the context.
CONTEXT_CARD1_OWNER
          The owner of the first card saved in the context.
CONTEXT_CARD2
          The card to use for the test with 'context.card2' is the second card saved in the context.
CONTEXT_CARD2_CONTROLLER
          The controller of the second card saved in the context.
CONTEXT_CARD2_OWNER
          The owner of the second card saved in the context.
CONTEXT_INT
          Player with id saved in the current context.
CONTEXT_INT2
          Player with id saved in the current context(2).
CONTEXT_PLAYER
          Player saved in the current context.
CONTEXT_TARGETABLE
          The card to use for the test with 'context.targetable' is the first targetable saved in the context.
CONTROLLER
          The controller.
CREATOR
          The creator of the current card.
CURRENT_CARD
          The active card in the stack owning the current spell or ability.
CURRENT_PLAYER
          Current player
CURRENT_PLAYER_OPPONENT
          Current player's opponent
EVENT_SOURCE
          The card to use for the test with 'context.event-source' is the source of current event.
FIRST_TARGET
          The card to use for the test with 'target-list.first' is the first card of the target list.
FIRST_TARGET_ATTACHED_TO
          The card to use for the test with 'target-list.first.attachedto' is the first card of the target list.
FIRST_TARGET_ATTACHED_TO_CONTROLLER
          The card to use for the test with 'target-list.first.attachedto.controller' is the first card of the target list.
FIRST_TARGET_ATTACHED_TO_OWNER
          The card to use for the test with 'target-list.first.attachedto.owner' is the first card of the target list.
FIRST_TARGET_CONTROLLER
          The card to use for the test with 'target-list.first.controller' is the first card of the target list.
FIRST_TARGET_OWNER
          The card to use for the test with 'target-list.first.owner' is the first card of the target list.
LAST_TARGET
          The card to use for the test with 'target-list.last' is the last card of the target list.
LAST_TARGET_ATTACHED_TO
          The card to use for the test with 'target-list.last.attachedto' is the last card of the target list.
LAST_TARGET_ATTACHED_TO_CONTROLLER
          The card to use for the test with 'target-list.last.attachedto.controller' is the last card of the target list.
LAST_TARGET_ATTACHED_TO_OWNER
          The card to use for the test with 'target-list.last.attachedto.owner' is the last card of the target list.
LAST_TARGET_CONTROLLER
          The card to use for the test with 'target-list.last.controller' is the last card of the target list.
LAST_TARGET_OWNER
          The card to use for the test with 'target-list.last.owner' is the last card of the target list.
MODIFIER_CREATOR
          The modifier creator card (may be different from THIS).
MODIFIER_CREATOR_CONTROLLER
          The modifier creator card (may be different from CONTROLLER).
MODIFIER_CREATOR_OWNER
          The modifier creator card (may be different from OWNER).
OPPONENT
          The opponent.
OWNER
          The card's owner.
SAVED
          Saved component
SAVED_CONTROLLER
          Controller of saved component
SAVED_OWNER
          Owner of saved component
SAVED2
          Saved component(2)
SAVED2_CONTROLLER
          Controller of saved component(2)
SAVED2_OWNER
          Owner of saved component(2)
SUPER
          The card to use for the test with 'super.tested' is like 'tested' it's the tested card outside the current 'counter' block.
TARGET_CONTROLLER
          The current card's controller.
TARGET_OWNER
          The current card's owner.
TESTED
          The card to use for the test with 'tested' is the current tested card.
THIS
          The card to use for the test with 'me', 'myself' is the card owning the test.
YOU
          The controller of current ability.
 
Method Summary
 boolean canBePreempted()
          Return true if the associated value can be evaluated without ability context.
static TestOn deserialize(java.io.InputStream input)
          Read and return the enum from the given inputstream.
 MCard getCard(Ability ability, ContextEventListener context, Targetable tested)
          Return the targetable instance cast in Card instance.
 MCard getCard(Ability ability, Targetable tested)
          Return the targetable instance cast in Card instance.
 Player getPlayer(Ability ability, ContextEventListener context, Targetable tested)
          Return the targetable on which the test would be applied
 Player getPlayer(Ability ability, Targetable tested)
          Return the targetable on which the test would be applied
 int getPreemptedValue(Ability ability, int index)
          Return the value corresponding to the true register index exactly as it will be when the ability will be executed. return the real number of a specifid idNumber.
 Targetable getTargetable(Ability ability, ContextEventListener context, Targetable tested)
          Return the targetable on which the test would be applied
 Targetable getTargetable(Ability ability, MCard card, ContextEventListener context, Targetable tested)
          Return the targetable on which the test would be applied
 Targetable getTargetable(Ability ability, Targetable tested)
          Return the targetable on which the test would be applied
 boolean isCard()
          Is this always referring to a card.
 boolean isPlayer()
          Is this always referring to a player.
 void serialize(java.io.OutputStream out)
          Write this enum to the given outputstream.
static void serialize(java.io.OutputStream out, java.lang.String xsdName)
          Write this enum to the given outputstream.
 java.lang.String toHtmlString(Ability ability, ContextEventListener context)
          Return the HTML code representing this action.
static TestOn valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static TestOn valueOfXsd(java.lang.String xsdName)
          Return null of enum value corresponding to the given Xsd name.
static TestOn[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ATTACHED_TO

public static final TestOn ATTACHED_TO
The card to use for the test with 'attachedto' is the card the card owning the test is attached to.


ATTACHED_TO_CONTROLLER

public static final TestOn ATTACHED_TO_CONTROLLER
The controller of 'attachedto' to.


ATTACHED_TO_OWNER

public static final TestOn ATTACHED_TO_OWNER
The owner of 'attachedto' to.


ATTACHED_TO_OF_TESTED

public static final TestOn ATTACHED_TO_OF_TESTED
The card to use for the test with 'tested.attachedto' is the card the 'tested' card is attached to.


CONTEXT_PLAYER

public static final TestOn CONTEXT_PLAYER
Player saved in the current context.


CONTEXT_INT

public static final TestOn CONTEXT_INT
Player with id saved in the current context.


CONTEXT_INT2

public static final TestOn CONTEXT_INT2
Player with id saved in the current context(2).


CONTEXT_TARGETABLE

public static final TestOn CONTEXT_TARGETABLE
The card to use for the test with 'context.targetable' is the first targetable saved in the context.


CONTEXT_CARD1

public static final TestOn CONTEXT_CARD1
The card to use for the test with 'context.card' is the first card saved in the context.


CONTEXT_CARD2

public static final TestOn CONTEXT_CARD2
The card to use for the test with 'context.card2' is the second card saved in the context.


CONTEXT_CARD2_CONTROLLER

public static final TestOn CONTEXT_CARD2_CONTROLLER
The controller of the second card saved in the context.


CONTEXT_CARD2_OWNER

public static final TestOn CONTEXT_CARD2_OWNER
The owner of the second card saved in the context.


CONTEXT_CARD1_CONTROLLER

public static final TestOn CONTEXT_CARD1_CONTROLLER
The controller of the first card saved in the context.


CONTEXT_CARD1_OWNER

public static final TestOn CONTEXT_CARD1_OWNER
The owner of the first card saved in the context.


CONTEXT_CARD_SHARE

public static final TestOn CONTEXT_CARD_SHARE
The Targetable cast to MCard object of this context without considering it's timstamp.


CONTROLLER

public static final TestOn CONTROLLER
The controller.


CREATOR

public static final TestOn CREATOR
The creator of the current card.


CURRENT_CARD

public static final TestOn CURRENT_CARD
The active card in the stack owning the current spell or ability. This should be used within a pre-condition of event.


CURRENT_PLAYER

public static final TestOn CURRENT_PLAYER
Current player


CURRENT_PLAYER_OPPONENT

public static final TestOn CURRENT_PLAYER_OPPONENT
Current player's opponent


EVENT_SOURCE

public static final TestOn EVENT_SOURCE
The card to use for the test with 'context.event-source' is the source of current event.


FIRST_TARGET

public static final TestOn FIRST_TARGET
The card to use for the test with 'target-list.first' is the first card of the target list.


FIRST_TARGET_ATTACHED_TO

public static final TestOn FIRST_TARGET_ATTACHED_TO
The card to use for the test with 'target-list.first.attachedto' is the first card of the target list.


FIRST_TARGET_ATTACHED_TO_OWNER

public static final TestOn FIRST_TARGET_ATTACHED_TO_OWNER
The card to use for the test with 'target-list.first.attachedto.owner' is the first card of the target list.


FIRST_TARGET_ATTACHED_TO_CONTROLLER

public static final TestOn FIRST_TARGET_ATTACHED_TO_CONTROLLER
The card to use for the test with 'target-list.first.attachedto.controller' is the first card of the target list.


FIRST_TARGET_CONTROLLER

public static final TestOn FIRST_TARGET_CONTROLLER
The card to use for the test with 'target-list.first.controller' is the first card of the target list.


FIRST_TARGET_OWNER

public static final TestOn FIRST_TARGET_OWNER
The card to use for the test with 'target-list.first.owner' is the first card of the target list.


LAST_TARGET

public static final TestOn LAST_TARGET
The card to use for the test with 'target-list.last' is the last card of the target list.


LAST_TARGET_ATTACHED_TO

public static final TestOn LAST_TARGET_ATTACHED_TO
The card to use for the test with 'target-list.last.attachedto' is the last card of the target list.


LAST_TARGET_ATTACHED_TO_OWNER

public static final TestOn LAST_TARGET_ATTACHED_TO_OWNER
The card to use for the test with 'target-list.last.attachedto.owner' is the last card of the target list.


LAST_TARGET_ATTACHED_TO_CONTROLLER

public static final TestOn LAST_TARGET_ATTACHED_TO_CONTROLLER
The card to use for the test with 'target-list.last.attachedto.controller' is the last card of the target list.


LAST_TARGET_CONTROLLER

public static final TestOn LAST_TARGET_CONTROLLER
The card to use for the test with 'target-list.last.controller' is the last card of the target list.


LAST_TARGET_OWNER

public static final TestOn LAST_TARGET_OWNER
The card to use for the test with 'target-list.last.owner' is the last card of the target list.


MODIFIER_CREATOR

public static final TestOn MODIFIER_CREATOR
The modifier creator card (may be different from THIS).


MODIFIER_CREATOR_CONTROLLER

public static final TestOn MODIFIER_CREATOR_CONTROLLER
The modifier creator card (may be different from CONTROLLER).


MODIFIER_CREATOR_OWNER

public static final TestOn MODIFIER_CREATOR_OWNER
The modifier creator card (may be different from OWNER).


OPPONENT

public static final TestOn OPPONENT
The opponent.


OWNER

public static final TestOn OWNER
The card's owner.


SAVED

public static final TestOn SAVED
Saved component


SAVED2

public static final TestOn SAVED2
Saved component(2)


SAVED_CONTROLLER

public static final TestOn SAVED_CONTROLLER
Controller of saved component


SAVED_OWNER

public static final TestOn SAVED_OWNER
Owner of saved component


SAVED2_CONTROLLER

public static final TestOn SAVED2_CONTROLLER
Controller of saved component(2)


SAVED2_OWNER

public static final TestOn SAVED2_OWNER
Owner of saved component(2)


SUPER

public static final TestOn SUPER
The card to use for the test with 'super.tested' is like 'tested' it's the tested card outside the current 'counter' block.


TARGET_CONTROLLER

public static final TestOn TARGET_CONTROLLER
The current card's controller. May be different from the controller of current ability.


TARGET_OWNER

public static final TestOn TARGET_OWNER
The current card's owner. May be different from the owner of current ability.


TESTED

public static final TestOn TESTED
The card to use for the test with 'tested' is the current tested card. It's the tested card for counter, or the main card of an event.


THIS

public static final TestOn THIS
The card to use for the test with 'me', 'myself' is the card owning the test.


YOU

public static final TestOn YOU
The controller of current ability. May be a bit different from card's 'controller'

Method Detail

values

public static TestOn[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TestOn c : TestOn.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TestOn valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getTargetable

public Targetable getTargetable(Ability ability,
                                Targetable tested)
Return the targetable on which the test would be applied

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
tested - the tested targetable
Returns:
the targetable to use for the test

getPlayer

public Player getPlayer(Ability ability,
                        Targetable tested)
Return the targetable on which the test would be applied

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
tested - the tested targetable
Returns:
the targetable to use for the test

getTargetable

public Targetable getTargetable(Ability ability,
                                ContextEventListener context,
                                Targetable tested)
Return the targetable on which the test would be applied

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - the current context.
tested - the tested targetable
Returns:
the targetable to use for the test

getPlayer

public Player getPlayer(Ability ability,
                        ContextEventListener context,
                        Targetable tested)
Return the targetable on which the test would be applied

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - the current context.
tested - the tested targetable
Returns:
the targetable to use for the test

getTargetable

public Targetable getTargetable(Ability ability,
                                MCard card,
                                ContextEventListener context,
                                Targetable tested)
Return the targetable on which the test would be applied

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
card - is the card owning the current ability.
context - the current context.
tested - the tested targetable
Returns:
the targetable to use for the test

getCard

public MCard getCard(Ability ability,
                     Targetable tested)
Return the targetable instance cast in Card instance.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
tested - the tested targetable
Returns:
the card to use for the test

getCard

public MCard getCard(Ability ability,
                     ContextEventListener context,
                     Targetable tested)
Return the targetable instance cast in Card instance.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - the current context.
tested - the tested targetable
Returns:
the card to use for the test

isCard

public boolean isCard()
Is this always referring to a card.

Returns:
true if this is always referring to a card.

isPlayer

public boolean isPlayer()
Is this always referring to a player.

Returns:
true if this is always referring to a player.

canBePreempted

public boolean canBePreempted()
Return true if the associated value can be evaluated without ability context.

Returns:
true if the associated value can be evaluated without ability context.

getPreemptedValue

public int getPreemptedValue(Ability ability,
                             int index)
Return the value corresponding to the true register index exactly as it will be when the ability will be executed. return the real number of a specifid idNumber. Since this number may reference to a token, a code matching is ran to determine which is the associated value.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
index - is the number where the real value will be extracted
Returns:
the real number associated to the specified idNumber

serialize

public static void serialize(java.io.OutputStream out,
                             java.lang.String xsdName)
                      throws java.io.IOException
Write this enum to the given outputstream.

Parameters:
out - the stream ths enum would be written.
xsdName - the Xsd name of this TestOn.
Throws:
java.io.IOException - If some other I/O error occurs

valueOfXsd

public static TestOn valueOfXsd(java.lang.String xsdName)
Return null of enum value corresponding to the given Xsd name.

Parameters:
xsdName - the Xsd name of this TestOn.
Returns:
null of enum value corresponding to the given Xsd name.

serialize

public void serialize(java.io.OutputStream out)
               throws java.io.IOException
Write this enum to the given outputstream.

Parameters:
out - the stream ths enum would be written.
Throws:
java.io.IOException - If some other I/O error occurs

deserialize

public static TestOn deserialize(java.io.InputStream input)
                          throws java.io.IOException
Read and return the enum from the given inputstream.

Parameters:
input - the stream containing the enum to read.
Returns:
the enum from the given inputstream.
Throws:
java.io.IOException - If some other I/O error occurs

toHtmlString

public java.lang.String toHtmlString(Ability ability,
                                     ContextEventListener context)
Return the HTML code representing this action. If no picture is associated to this action, only text will be returned.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.
context - is the context attached to this action.
Returns:
the HTML code representing this action. If no picture is associated to this action, only text will be returned.


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