1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.magicproject.stack;
20
21 import java.util.LinkedList;
22 import java.util.List;
23
24 import net.sf.magicproject.clickable.ability.Ability;
25 import net.sf.magicproject.clickable.targetable.card.MCard;
26
27 /***
28 * MChoice.java Created on 27 octobre 2002, 12:15
29 *
30 * @author Fabrice Daugan
31 */
32 public class ActivatedChoice {
33
34 /***
35 * creates a new instance of MChoice with a specified ability. Other abilities
36 * can be added.
37 *
38 * @param ability
39 * is the first ability of this choice
40 * @see #addAbility(Ability)
41 */
42 public ActivatedChoice(Ability ability) {
43 abilities.add(ability);
44 }
45
46 /***
47 * return the card owning these activated abilities
48 *
49 * @return the card owning these activated abilities
50 */
51 public MCard getCard() {
52 return abilities.get(0).getCard();
53 }
54
55 /***
56 * highlight the card containing the abilities of this choice.
57 *
58 * @param highlightedZone
59 * the set of highlighted zone.
60 */
61 public void highLight(boolean... highlightedZone) {
62 getCard().highLight(highlightedZone);
63 }
64
65 /***
66 * dishighlight the card containing the abilities of this choice
67 */
68 public void disHighLight() {
69 getCard().disHighLight();
70 }
71
72 /***
73 * add an ability to the list of abilities of this choice
74 *
75 * @param ability
76 * is the ability to add to this choice
77 */
78 public void addAbility(Ability ability) {
79 abilities.add(ability);
80 }
81
82 /***
83 * remove all abilities activated for this card
84 */
85 public void clear() {
86 abilities.clear();
87 }
88
89 /***
90 * contains UserAbility items concerned by the current idEvent
91 */
92 public List<Ability> abilities = new LinkedList<Ability>();
93
94 }