net.sf.magicproject.modifier
Class ModifierModel

java.lang.Object
  extended by net.sf.magicproject.modifier.ModifierModel
Direct Known Subclasses:
AbilityModifierModel, AdditionalCostModifierModel, ColorModifierModel, ControllerModifierModel, IdCardModifierModel, PlayableZoneModifierModel, PropertyModifierModel, RegisterIndirectionModel, RegisterModifierModel, StaticModifierModel

public abstract class ModifierModel
extends java.lang.Object

Since:
0.85 Recalculate attribute is supported
Author:
Fabrice Daugan

Method Summary
 void addModel(ModifierModel modelToAdd)
          Add to the list of modifierModels of the specified card, this instance.
abstract  void addModifierFromModel(Ability ability, MCard target)
          Create modifier(s) on the specified target.
 void addStaticModifierFromModel(Ability ability)
          Add all static modifiers.
abstract  ModifierModel clone()
           
 void removeObject(MCard fromCard, Test objectTest)
          Remove one instance of this object from the given card.
abstract  java.lang.String toHtmlString(Ability ability, ContextEventListener context)
          Return the HTML code representing this action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addModel

public final void addModel(ModifierModel modelToAdd)
Add to the list of modifierModels of the specified card, this instance.

Parameters:
modelToAdd - This new modifier will be added to the tail of modifier list.

clone

public abstract ModifierModel clone()
Overrides:
clone in class java.lang.Object

addModifierFromModel

public abstract void addModifierFromModel(Ability ability,
                                          MCard target)
Create modifier(s) on the specified target.

Parameters:
ability - is the ability owning causin the creation of this modifier. The card component of this ability should correspond to the card owning this test too.
target - is the card this new modifier would be attached to.

toHtmlString

public abstract java.lang.String toHtmlString(Ability ability,
                                              ContextEventListener context)
Return the HTML code representing this action. If this action is named, it's name will be returned. If not, if existing, the picture associated to this action is returned. Otherwise, built-in action's 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 - the context needed by event activated
Returns:
the HTML code representing this action. If this action is named, it's name will be returned. If not, if existing, the picture associated to this action is returned. Otherwise, built-in action's text will be returned.
Since:
0.86

removeObject

public void removeObject(MCard fromCard,
                         Test objectTest)
Remove one instance of this object from the given card.

Parameters:
fromCard -
objectTest - The test applied on specific modifier to be removed.

addStaticModifierFromModel

public void addStaticModifierFromModel(Ability ability)
Add all static modifiers.

Parameters:
ability - is the ability owning this test. The card component of this ability should correspond to the card owning this test too.


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