aigames.soccer.field
Interface GameField

All Known Implementing Classes:
BasicGameField

public interface GameField

This interface represents field for soccer game.

Version:
$Id: GameField.java,v 1.7 2004/05/08 21:55:25 mwerla Exp $

Method Summary
 float getAvgMoveLength(int color)
          Returns average move length for a given color.
 java.awt.Point getCurrentPosition()
          Returns current position of a ball.
 FieldPoint getFieldPoint(int x, int y)
          Returns field point at given coordinates.
 int getMaximumXIndex()
          Returns maximum X index.
 int getMaximumYIndex()
          Returns maximum Y index.
 int getNumberOfMoves(int color)
          Returns number of moves for a given color.
 boolean isDeadLock()
          Checks if there is ball deadlock.
 boolean isGameOver()
          Checks if there is game over.
 int isGoal()
          Checks if there is goal.
 void makeMove(Move move, int color)
          Makes move for a proper player.
 void startGame()
          Sets the ball in the starting position of the field and sets starting player according to given parameter.
 

Method Detail

makeMove

public void makeMove(Move move,
                     int color)
              throws InvalidMoveException
Makes move for a proper player.

Parameters:
move - Move that will be made.
color - Color for the new move.
Throws:
InvalidMoveException - Thrown when move is invalid for current game field state.

getCurrentPosition

public java.awt.Point getCurrentPosition()
Returns current position of a ball.

Returns:
Current position of a ball.

startGame

public void startGame()
Sets the ball in the starting position of the field and sets starting player according to given parameter.


isGameOver

public boolean isGameOver()
Checks if there is game over.

Returns:
True if there is game over, otherwise false.

isDeadLock

public boolean isDeadLock()
Checks if there is ball deadlock.

Returns:
True if there is ball deadlock, otherwise false.

isGoal

public int isGoal()
Checks if there is goal.

Returns:
-1 (left side) or 1 (right side) if there is goal, otherwise 0.

getNumberOfMoves

public int getNumberOfMoves(int color)
Returns number of moves for a given color.

Parameters:
color - Color to check.
Returns:
Number of moves for a given color.

getAvgMoveLength

public float getAvgMoveLength(int color)
Returns average move length for a given color.

Parameters:
color - Color to check.
Returns:
Average move length for a given color.

getFieldPoint

public FieldPoint getFieldPoint(int x,
                                int y)
Returns field point at given coordinates.

Parameters:
x - X point coordinate.
y - y point coordinate.
Returns:
Field point at given coordinates.

getMaximumXIndex

public int getMaximumXIndex()
Returns maximum X index.

Returns:
Maximum X index

getMaximumYIndex

public int getMaximumYIndex()
Returns maximum Y index.

Returns:
Maximum Y index


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