net.sf.magicproject.clickable.ability
Enum Priority

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

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

Possible optimizations for abilities management in the TBZ

Author:
Fabrice Daugan

Enum Constant Summary
auto
          Indicates wether this ability is resolved completely before player can get priority.
hidden
          Indicates wether this ability is resolved completely before player can get priority (like isAutoResolve), and stack is resolved immediatly after it has been added to the stack.
hidden_high
          As HIDDEN tag, but the ability is choosen before the other hidden abilities without this tag .
hidden_low
          As hidden tag, but the ability is choosen after the other hidden abilities without this tag .
high
          Indicates wether this ability is choosen in priority to the others without this tag.
normal
          Indicates the ability would be resoved depending on the current flow.
 
Method Summary
 java.util.List<TriggeredCard> getAbstractZone(java.util.List<TriggeredCard> abstractLowestZone, java.util.List<TriggeredCard> abstractZone, java.util.List<TriggeredCard> abstractHighestZone)
          Following the class, returns the abstract zone where the specified ability should be added.
 boolean hasHighPriority()
          Indicates wether this ability is choosen in priority to the others without this tag.
 boolean isAutoResolve()
          Indicates if this ability is immediatly after it has been added to the stack.
 boolean isHidden()
          Indicates wether this ability is resolved completely before player can get priority (like isAutoResolve), and stack is resolved immediatly after it has been added to the stack.
 void registerToManager(ReplacementAbility ability)
          Register the specified replacement ability.
 void removeFromManager(ReplacementAbility ability)
          Unregister the specified replacement ability.
static Priority valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Priority[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void write(java.io.OutputStream out)
          Wrtite this enum to the given outputstream.
 
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

hidden_high

public static final Priority hidden_high
As HIDDEN tag, but the ability is choosen before the other hidden abilities without this tag .


hidden

public static final Priority hidden
Indicates wether this ability is resolved completely before player can get priority (like isAutoResolve), and stack is resolved immediatly after it has been added to the stack. No information displayed or prompted to the players. Users will not see this ability played.


hidden_low

public static final Priority hidden_low
As hidden tag, but the ability is choosen after the other hidden abilities without this tag .


high

public static final Priority high
Indicates wether this ability is choosen in priority to the others without this tag.


auto

public static final Priority auto
Indicates wether this ability is resolved completely before player can get priority.


normal

public static final Priority normal
Indicates the ability would be resoved depending on the current flow. Often, need user intervention to be played and resolved.

Method Detail

values

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

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

valueOf

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

hasHighPriority

public boolean hasHighPriority()
Indicates wether this ability is choosen in priority to the others without this tag.

Returns:
true if this ability is choosen in priority to the others without this tag.

isAutoResolve

public boolean isAutoResolve()
Indicates if this ability is immediatly after it has been added to the stack. Note it's not says immediatly it has been triggered or playable, but says it has been activated - so added directly to the stack -, or has been triggered - so added to the triggered buffer zone - and then has been selected to be moved to the stack.

Returns:
true if this ability is immediatly after it has been added to the stack.

isHidden

public boolean isHidden()
Indicates wether this ability is resolved completely before player can get priority (like isAutoResolve), and stack is resolved immediatly after it has been added to the stack. No information displayed or prompted to the players. Users will not see this ability played.

Returns:
true if this ability is resolved completely before player can get priority (like isAutoResolve), and stack is resolved immediatly after it has been added to the stack.

removeFromManager

public void removeFromManager(ReplacementAbility ability)
Unregister the specified replacement ability.

Parameters:
ability - the replacement ability to unregister.

getAbstractZone

public java.util.List<TriggeredCard> getAbstractZone(java.util.List<TriggeredCard> abstractLowestZone,
                                                     java.util.List<TriggeredCard> abstractZone,
                                                     java.util.List<TriggeredCard> abstractHighestZone)
Following the class, returns the abstract zone where the specified ability should be added.

Parameters:
abstractLowestZone - the abstract zone corresponding to the zone containing abilities with the lowest priority of hidden abilities.
abstractZone - the abstract zone corresponding to the zone containing abilities with the normal priority of hidden abilities.
abstractHighestZone - the abstract zone corresponding to the zone containing abilities with the highest priority of hidden abilities.
Returns:
the abstract zone where the specified ability should be added.

registerToManager

public void registerToManager(ReplacementAbility ability)
Register the specified replacement ability.

Parameters:
ability - the replacement ability to register.

write

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

Parameters:
out - the stream ths enum would be written.
Throws:
java.io.IOException


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