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   */
20  
21  package net.sf.magicproject.clickable.targetable.card;
22  
23  import net.sf.magicproject.clickable.ability.Ability;
24  import net.sf.magicproject.modifier.ModifierModel;
25  
26  /***
27   * @since 0.90
28   * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
29   * @author <a href="mailto:kismet-sl@users.sourceforge.net">Stefano "Kismet"
30   *         Lenzi</a>
31   */
32  public interface CardModel extends Comparable<CardModel> {
33  
34  	/***
35  	 * Returns the language used for this card.
36  	 * 
37  	 * @return the language used for this card.
38  	 */
39  	String getLanguage();
40  
41  	/***
42  	 * Returns the file-serializable card name.
43  	 * 
44  	 * @return the file-serializable card name.
45  	 */
46  	String getKeyName();
47  
48  	/***
49  	 * Returns the english name of this card. May contain any character. If null
50  	 * or empty, it would be equals to the card name (id).
51  	 * 
52  	 * @return the english card name.
53  	 */
54  	String getCardName();
55  
56  	/***
57  	 * XML rule designer of loaded cards.
58  	 * 
59  	 * @return XML rule designer of loaded cards.
60  	 */
61  	String getRulesCredit();
62  
63  	/***
64  	 * Indicates this card contains or not the specified keyword. Keywords are not
65  	 * case sensitive.
66  	 * 
67  	 * @param keyword
68  	 *          the tested keyword.
69  	 * @return true if the keyword is known by this card.
70  	 */
71  	boolean hasKeywords(String keyword);
72  
73  	/***
74  	 * Returns the translated name. If null or empty, it would be equals to the
75  	 * given english name.
76  	 * 
77  	 * @return the translated card name.
78  	 */
79  	String getLocalName();
80  
81  	/***
82  	 * Set the translated card name.
83  	 * 
84  	 * @param localName
85  	 *          the new local name.
86  	 */
87  	void setLocalName(String localName);
88  
89  	/***
90  	 * Set XML rule designer of this card.
91  	 * 
92  	 * @param cardRulesCredits
93  	 *          the XML rule designer of loaded cards.
94  	 */
95  	void setRulesCredits(String cardRulesCredits);
96  
97  	/***
98  	 * Return the type of this card
99  	 * 
100 	 * @return Card type of this card
101 	 * @since 0.91
102 	 */
103 	int getIdCard();
104 
105 	/***
106 	 * Return the printed Colors of this card.
107 	 * 
108 	 * @return printed Colors of this card.
109 	 * @since 0.91
110 	 */
111 	int getIdColor();
112 
113 	/***
114 	 * Return shared registers of this targetable. This register would never be
115 	 * modifier.
116 	 * 
117 	 * @return shared registers of this targetable.
118 	 * @since 0.91
119 	 */
120 	int[] getStaticRegisters();
121 
122 	/***
123 	 * Return the properties of this card. These properties are these one readable
124 	 * on card itself.
125 	 * 
126 	 * @return the properties for this card.
127 	 * @since 0.91
128 	 */
129 	int[] getProperties();
130 
131 	/***
132 	 * Return the list of actions when casting
133 	 * 
134 	 * @return List of actions when casting
135 	 */
136 	Ability[] getAbilities();
137 
138 	/***
139 	 * Set the shared modifier models. All cards with same id have the same
140 	 * modifier models objects
141 	 * 
142 	 * @param modifierModels
143 	 *          The new modifierModels to set.
144 	 * @since 0.91
145 	 */
146 	void setModifierModels(ModifierModel modifierModels);
147 
148 	/***
149 	 * Return the shared modifier models. All cards with same id have the same
150 	 * modifier models objects
151 	 * 
152 	 * @since 0.91
153 	 * @return the shared modifier models.
154 	 */
155 	ModifierModel getModifierModels();
156 
157 	/***
158 	 * Returns the optional attachment condition and modifiers brought by this
159 	 * card.
160 	 * 
161 	 * @return the optional attachment condition and modifiers brought by this
162 	 *         card. Return <code>null</code> if there is no attachment brought
163 	 *         by this card.
164 	 */
165 	Attachment getAttachment();
166 
167 	int compareTo(CardModel o);
168 
169 }