1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package net.sf.magicproject.action;
23
24 import net.sf.magicproject.action.handler.StandardAction;
25 import net.sf.magicproject.clickable.ability.Ability;
26 import net.sf.magicproject.event.context.ContextEventListener;
27 import net.sf.magicproject.modifier.Modifier;
28
29 /***
30 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
31 */
32 public class RefreshModifier extends MAction implements StandardAction {
33
34 /***
35 * Creates a new instance of RemoveMe <br>
36 *
37 * @param modifier
38 */
39 public RefreshModifier(Modifier modifier) {
40 super();
41 this.modifier = modifier;
42 }
43
44 /***
45 * The modifier to remove with this action
46 */
47 private Modifier modifier;
48
49 /***
50 * Return the index of this action. As default, this is a zero id
51 *
52 * @return the index of this action.
53 * @see Actiontype
54 */
55 @Override
56 public final Actiontype getIdAction() {
57 return Actiontype.REFRESH_MODIFIER;
58 }
59
60 public boolean play(ContextEventListener context, Ability ability) {
61 modifier.refresh();
62 return true;
63 }
64
65 @Override
66 public String toString(Ability ability) {
67 return "refresh modifier : " + modifier;
68 }
69
70 }