net.sf.magicproject.token
Enum AbstractValue

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

public enum AbstractValue
extends java.lang.Enum<AbstractValue>

Since:
0.93
Author:
Fabrice Daugan

Enum Constant Summary
ALL
          The owner of the second card saved in the context.
CONTEXT_INT
          Special access to the integer saved into the context of current spell.
CONTEXT_INT2
          Special access to the second integer saved into the context of current spell.
CURRENT_PHASE_INDEX
          Special access to current phase index.
INT_LIST_FIRST
          Special access to the first int of current int list
INT_LIST_LAST
          Special access to the last int of current int list
INT_LIST_SIZE
          Special access to the current int list size
SAVED_INT_LIST_SIZE
          Special access to the saved int list size
SAVED_TARGET_LIST_SIZE
          Special access to the saved target list size
TARGET_LIST_SIZE
          Special access to the current target list size
TURN_ID
          Special access to the static value correponding to the turn number.
 
Method Summary
static AbstractValue deserialize(java.io.InputStream input)
          Read and return the enum from the given inputstream.
 int getValue(Ability ability, MCard card, ContextEventListener context, Targetable tested)
          Return the targetable on which the test would be applied
 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.
static AbstractValue valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AbstractValue valueOfXsd(java.lang.String xsdName)
          Return null of enum value corresponding to the given Xsd name.
static AbstractValue[] 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

CONTEXT_INT

public static final AbstractValue CONTEXT_INT
Special access to the integer saved into the context of current spell.


CONTEXT_INT2

public static final AbstractValue CONTEXT_INT2
Special access to the second integer saved into the context of current spell.


TARGET_LIST_SIZE

public static final AbstractValue TARGET_LIST_SIZE
Special access to the current target list size


TURN_ID

public static final AbstractValue TURN_ID
Special access to the static value correponding to the turn number. The first turn should be 0.


INT_LIST_FIRST

public static final AbstractValue INT_LIST_FIRST
Special access to the first int of current int list


INT_LIST_LAST

public static final AbstractValue INT_LIST_LAST
Special access to the last int of current int list


INT_LIST_SIZE

public static final AbstractValue INT_LIST_SIZE
Special access to the current int list size


SAVED_INT_LIST_SIZE

public static final AbstractValue SAVED_INT_LIST_SIZE
Special access to the saved int list size


SAVED_TARGET_LIST_SIZE

public static final AbstractValue SAVED_TARGET_LIST_SIZE
Special access to the saved target list size


CURRENT_PHASE_INDEX

public static final AbstractValue CURRENT_PHASE_INDEX
Special access to current phase index.


ALL

public static final AbstractValue ALL
The owner of the second card saved in the context.

Method Detail

values

public static AbstractValue[] 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 (AbstractValue c : AbstractValue.values())
    System.out.println(c);

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

valueOf

public static AbstractValue 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

getValue

public int getValue(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

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 AbstractValue valueOfXsd(java.lang.String xsdName)
Return null of enum value corresponding to the given Xsd name.

Parameters:
xsdName - the Xsd name of this Aabstract value.
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 AbstractValue 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


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