aigames.soccer.field.constructor
Class StandardConstructor

java.lang.Object
  extended byaigames.soccer.field.constructor.StandardConstructor
All Implemented Interfaces:
Constructor

public class StandardConstructor
extends java.lang.Object
implements Constructor

Field costructor for typical soccer game field.

Version:
$Id: StandardConstructor.java,v 1.10 2004/05/08 21:55:30 mwerla Exp $

Constructor Summary
StandardConstructor(int width, int height, int goal)
          Class constructor.
 
Method Summary
 FieldPoint[][] getNewField()
          Returns new blank game field.
 java.awt.Point getStartingPosition()
          Returns starting position.
 boolean isGameOverPosition(java.awt.Point position)
          Checks if given position is game over position.
 int isGoalPosition(java.awt.Point position)
          Checks if given position is goal over position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardConstructor

public StandardConstructor(int width,
                           int height,
                           int goal)
                    throws java.lang.IllegalArgumentException
Class constructor.

Parameters:
width - Field width.
height - Field height.
goal - Goal height.
Throws:
java.lang.IllegalArgumentException - Thrown when field sizes are wrong.
Method Detail

getNewField

public FieldPoint[][] getNewField()
Description copied from interface: Constructor
Returns new blank game field.

Specified by:
getNewField in interface Constructor
Returns:
New blank game field.
See Also:
Constructor.getNewField()

getStartingPosition

public java.awt.Point getStartingPosition()
Description copied from interface: Constructor
Returns starting position.

Specified by:
getStartingPosition in interface Constructor
Returns:
Starting position.
See Also:
Constructor.getStartingPosition()

isGameOverPosition

public boolean isGameOverPosition(java.awt.Point position)
Description copied from interface: Constructor
Checks if given position is game over position.

Specified by:
isGameOverPosition in interface Constructor
Parameters:
position - Position to check.
Returns:
True if given position is game over position, otherwise flase.
See Also:
Constructor.isGameOverPosition(java.awt.Point)

isGoalPosition

public int isGoalPosition(java.awt.Point position)
Description copied from interface: Constructor
Checks if given position is goal over position.

Specified by:
isGoalPosition in interface Constructor
Parameters:
position - Position to check.
Returns:
-1 (left side) or 1 (right side) if there is a goal, otherwise 0.
See Also:
Constructor.isGoalPosition(Point)


Copyright © 2001-2004 MoMaT & MWe Team. All Rights Reserved.