View Javadoc

1   /*
2    *   Magic-Project is a turn based strategy simulator
3    *   Copyright (C) 2003-2007 Fabrice Daugan
4    *
5    *   This program is free software; you can redistribute it and/or modify it 
6    * under the terms of the GNU General Public License as published by the Free 
7    * Software Foundation; either version 2 of the License, or (at your option) any
8    * later version.
9    *
10   *   This program is distributed in the hope that it will be useful, but WITHOUT 
11   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
13   * details.
14   *
15   *   You should have received a copy of the GNU General Public License along  
16   * with this program; if not, write to the Free Software Foundation, Inc., 
17   * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  }