net.sf.magicproject.expression
Class IntValue

java.lang.Object
  extended by net.sf.magicproject.expression.Expression
      extended by net.sf.magicproject.expression.IntValue

public class IntValue
extends Expression

Since:
0.91 the pre-empted value of ALL, is ONE.
Author:
Fabrice Daugan

Field Summary
 int value
          The integer value of this expression
 
Constructor Summary
IntValue(java.io.InputStream inputFile)
          Creates a new instance of IntValue
Structure of InputStream : Data[size] int 16 value [2]
IntValue(int value)
          Creates a new instance of IntValue with a specified value.
 
Method Summary
 int getPreemptionValue(Ability ability, Targetable tested, ContextEventListener context)
          Returns the integer value of this expression exactly as it will be when the ability will be executed.
 int getValue(Ability ability, Targetable tested, ContextEventListener context)
          Returns the integer value of this expression
 boolean isConstant()
          Is this expression is a constant.
 java.lang.String toString()
           
 
Methods inherited from class net.sf.magicproject.expression.Expression
canBePreempted, extractTriggeredEvents, getConstraintExpression, getObject, getObjectClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public int value
The integer value of this expression

Constructor Detail

IntValue

public IntValue(java.io.InputStream inputFile)
         throws java.io.IOException
Creates a new instance of IntValue

Parameters:
inputFile - file containing this action
Throws:
java.io.IOException - if error occurred during the reading process from the specified input stream

IntValue

public IntValue(int value)
Creates a new instance of IntValue with a specified value.

Parameters:
value - integer value of this expression
Method Detail

getPreemptionValue

public int getPreemptionValue(Ability ability,
                              Targetable tested,
                              ContextEventListener context)
Description copied from class: Expression
Returns the integer value of this expression exactly as it will be when the ability will be executed.

Overrides:
getPreemptionValue in class Expression
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 card
context - is the context attached to this test.
Returns:
the integer value of this expression. Returns -1 if is not preemptable.

getValue

public int getValue(Ability ability,
                    Targetable tested,
                    ContextEventListener context)
Description copied from class: Expression
Returns the integer value of this expression

Specified by:
getValue in class Expression
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 card
context - is the context attached to this test.
Returns:
the integer value of this expression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isConstant

public boolean isConstant()
Description copied from class: Expression
Is this expression is a constant.

Overrides:
isConstant in class Expression
Returns:
true if this expression is a constant.


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