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.clickable.ability;
23
24 import java.util.List;
25
26 import net.sf.magicproject.action.MAction;
27 import net.sf.magicproject.clickable.targetable.card.MCard;
28 import net.sf.magicproject.clickable.targetable.card.SystemCard;
29 import net.sf.magicproject.event.MEventListener;
30 import net.sf.magicproject.token.TrueFalseAuto;
31
32 /***
33 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
34 */
35 public abstract class AbstractAbility extends Ability {
36
37 /***
38 * Creates a new instance of AbstractAbility <br>
39 *
40 * @param name
41 * the ability name
42 * @param event
43 * the event attached to this ability.
44 * @param pictureName
45 * the optional picture used to display this ability.
46 * @param linkedAbilities
47 * the linked abilities. May be null.
48 * @param playAsSpell
49 * play-as-spell.
50 */
51 public AbstractAbility(String name, MEventListener event, String pictureName,
52 List<Ability> linkedAbilities, TrueFalseAuto playAsSpell) {
53 super(name, Optimization.none, Priority.hidden, pictureName,
54 linkedAbilities, playAsSpell);
55 eventComing = event;
56 }
57
58 @Override
59 public MCard getCard() {
60 return SystemCard.instance;
61 }
62
63 @Override
64 public boolean isMatching() {
65 return true;
66 }
67
68 @Override
69 public MAction[] actionList() {
70 return actionList;
71 }
72
73 @Override
74 public MAction[] effectList() {
75 return effectList;
76 }
77
78 @Override
79 public boolean recheckTargets() {
80 return true;
81 }
82
83 /***
84 * will contains MAction objects of cost part
85 */
86 protected MAction[] actionList;
87
88 /***
89 * will contains MAction objects of effect part
90 */
91 protected MAction[] effectList;
92 }