|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aigames.soccer.field.BasicGameField
Constructor Summary | |
BasicGameField(Constructor fieldConstructor)
Class contructor which uses given field constructor to create new field. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicGameField(Constructor fieldConstructor)
fieldConstructor
- Field constructor used to create new field.Method Detail |
public void makeMove(Move move, int color) throws InvalidMoveException
GameField
makeMove
in interface GameField
move
- Move that will be made.color
- Color for the new move.
InvalidMoveException
- Thrown when move is invalid
for current game field state.GameField.makeMove(Move, int)
public boolean isDeadLock()
GameField
isDeadLock
in interface GameField
GameField.isDeadLock()
public java.awt.Point getCurrentPosition()
GameField
getCurrentPosition
in interface GameField
GameField.getCurrentPosition()
public void startGame()
GameField
startGame
in interface GameField
GameField.startGame()
public int isGoal()
GameField
isGoal
in interface GameField
GameField.isGoal()
public boolean isGameOver()
GameField
isGameOver
in interface GameField
GameField.isGameOver()
public int getNumberOfMoves(int color)
GameField
getNumberOfMoves
in interface GameField
color
- Color to check.
GameField.getNumberOfMoves(int)
public float getAvgMoveLength(int color)
GameField
getAvgMoveLength
in interface GameField
color
- Color to check.
GameField.getAvgMoveLength(int)
public FieldPoint getFieldPoint(int x, int y)
GameField
getFieldPoint
in interface GameField
x
- X point coordinate.y
- y point coordinate.
GameField.getFieldPoint(int, int)
public int getMaximumXIndex()
GameField
getMaximumXIndex
in interface GameField
GameField.getMaximumXIndex()
public int getMaximumYIndex()
GameField
getMaximumYIndex
in interface GameField
GameField.getMaximumYIndex()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |