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.modifier;
20  
21  import java.awt.Graphics;
22  
23  import net.sf.magicproject.test.Test;
24  
25  
26  /***
27   * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
28   * @since 0.86
29   */
30  public interface ObjectModifier {
31  
32  	/***
33  	 * remove from the manager a occurence of object with the specified name
34  	 * 
35  	 * @param objectName
36  	 *          the object's name to remove
37  	 * @param objectTest
38  	 *          The test applied on specific modifier to be removed.
39  	 * @return the new chain
40  	 */
41  	Modifier removeObject(String objectName, Test objectTest);
42  
43  	/***
44  	 * Paint all objects of the given MCard component.
45  	 * 
46  	 * @param g
47  	 *          the graphics used ot paint this object.
48  	 * @param startX
49  	 *          the x position where this object can be paint.
50  	 * @param startY
51  	 *          the y position where this object can be paint.
52  	 * @return the next free object position.
53  	 */
54  	int paintObject(Graphics g, int startX, int startY);
55  
56  	/***
57  	 * Return occurences number of the given object with the given name.
58  	 * 
59  	 * @param objectName
60  	 *          the object's name to find within this chain.
61  	 * @param objectTest
62  	 *          The test applied on specific modifier to be removed.
63  	 * @return occurences number of the given object with the given name.
64  	 */
65  	int getNbObjects(String objectName, Test objectTest);
66  
67  }