View Javadoc

1   /*
2    * AI Soccer Project - network gaming environment for AI warriors.
3    * Copyright (C) 2001-2004  Marcin Werla, Pawel Widera
4    *
5    * This program is free software; you can redistribute it and/or
6    * modify it under the terms of the GNU General Public License
7    * as published by the Free Software Foundation; either version 2
8    * of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with this program; if not, you can find it here:
17   * http://www.gnu.org/licenses/gpl.html
18   */
19  
20  package aigames.soccer.field.constructor;
21  
22  import aigames.soccer.field.FieldPoint;
23  
24  import java.awt.Point;
25  
26  
27  /***
28   * This interface describes classes that are used to create game field shape.
29   * @version $Id: Constructor.java,v 1.4 2004/05/08 21:55:30 mwerla Exp $
30   */
31  public interface Constructor {
32      /***
33       * Returns new blank game field.
34       * @return New blank game field.
35       */
36      public FieldPoint[][] getNewField();
37  
38      /***
39       * Returns starting position.
40       * @return Starting position.
41       */
42      public Point getStartingPosition();
43  
44      /***
45       * Checks if given position is game over position.
46       * @param position Position to check.
47       * @return True if given position is game over position, otherwise flase.
48       */
49      public boolean isGameOverPosition(Point position);
50  
51      /***
52       * Checks if given position is goal over position.
53       * @param position Position to check.
54       * @return -1 (left side) or 1 (right side) if there is a goal, otherwise 0.
55       */
56      public int isGoalPosition(Point position);
57  }