net.sf.magicproject.modifier
Class ObjectAbilityModifierModel

java.lang.Object
  extended by net.sf.magicproject.modifier.ModifierModel
      extended by net.sf.magicproject.modifier.AbilityModifierModel
          extended by net.sf.magicproject.modifier.ObjectAbilityModifierModel
All Implemented Interfaces:
java.lang.Cloneable, ObjectModifierModel

public class ObjectAbilityModifierModel
extends AbilityModifierModel
implements ObjectModifierModel

Since:
0.82
Author:
Fabrice Daugan

Method Summary
 void addModifierFromModel(Ability ability, MCard target)
          Create modifier(s) on the specified target.
 ObjectAbilityModifierModel clone()
          Creates and returns a copy of this object.
 int getNbObject(MCard card, Test objectTest)
          Return occurences number of the given object with the given name.
 java.lang.String getObjectName()
          Return the object name
 void removeObject(MCard fromCard, Test objectTest)
          Remove one instance of this object from the given card.
 
Methods inherited from class net.sf.magicproject.modifier.AbilityModifierModel
toHtmlString
 
Methods inherited from class net.sf.magicproject.modifier.ModifierModel
addModel, addStaticModifierFromModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addModifierFromModel

public void addModifierFromModel(Ability ability,
                                 MCard target)
Description copied from class: ModifierModel
Create modifier(s) on the specified target.

Specified by:
addModifierFromModel in interface ObjectModifierModel
Overrides:
addModifierFromModel in class AbilityModifierModel
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.

clone

public ObjectAbilityModifierModel clone()
Description copied from interface: ObjectModifierModel
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object.

Specified by:
clone in interface ObjectModifierModel
Overrides:
clone in class AbilityModifierModel
Returns:
a clone of this instance.
See Also:
Cloneable

getObjectName

public java.lang.String getObjectName()
Description copied from interface: ObjectModifierModel
Return the object name

Specified by:
getObjectName in interface ObjectModifierModel
Returns:
the object name

removeObject

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

Specified by:
removeObject in interface ObjectModifierModel
Overrides:
removeObject in class ModifierModel
objectTest - The test applied on specific modifier to be removed.

getNbObject

public int getNbObject(MCard card,
                       Test objectTest)
Description copied from interface: ObjectModifierModel
Return occurences number of the given object with the given name.

Specified by:
getNbObject in interface ObjectModifierModel
Parameters:
card - the card on which objects will be counted.
objectTest - The test applied on specific modifier to be removed.
Returns:
occurences number of this object attached to the given card.


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