1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.firemox.modifier;
21
22 import net.sf.firemox.action.AddModifierFromStaticModifier;
23 import net.sf.firemox.clickable.ability.TriggeredStaticModifierAbility;
24 import net.sf.firemox.event.MovedCard;
25 import net.sf.firemox.modifier.model.ModifierModel;
26 import net.sf.firemox.test.InZone;
27 import net.sf.firemox.test.TestOn;
28 import net.sf.firemox.test.True;
29 import net.sf.firemox.token.IdZones;
30
31 /***
32 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
33 * @since 0.86 Any event interfering with the filter-test make this
34 * static-modifier to be re-evaluated for the concerned card.
35 */
36 public class StaticModifier extends Modifier {
37
38 /***
39 * Creates a new instance of StaticModifier <br>
40 *
41 * @param context
42 * the modifier context.
43 * @param modifiers
44 * are the modifiers attached to this static way to attach globally
45 * card in the looked for zone.
46 * @param filterZone
47 * is the looked for zone where this modifier can be added. Only
48 * components in this zone are affected by this modifier.
49 */
50 public StaticModifier(ModifierContext context, ModifierModel[] modifiers,
51 int filterZone) {
52 super(context);
53
54
55 if (filterZone != IdZones.ANYWHERE) {
56 final TriggeredStaticModifierAbility refreshAbility = new TriggeredStaticModifierAbility(
57 new MovedCard(filterZone, True.getInstance(), new InZone(filterZone,
58 TestOn.TESTED), ability.getCard()),
59 new AddModifierFromStaticModifier(modifiers), ability.getCard(),
60 modifiers);
61 abilities.add(refreshAbility);
62 refreshAbility.registerToManager();
63 }
64 }
65
66 @Override
67 public void refresh() {
68
69
70
71 }
72
73 }