|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectaigames.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 GameFieldmove - 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 GameFieldGameField.isDeadLock()public java.awt.Point getCurrentPosition()
GameField
getCurrentPosition in interface GameFieldGameField.getCurrentPosition()public void startGame()
GameField
startGame in interface GameFieldGameField.startGame()public int isGoal()
GameField
isGoal in interface GameFieldGameField.isGoal()public boolean isGameOver()
GameField
isGameOver in interface GameFieldGameField.isGameOver()public int getNumberOfMoves(int color)
GameField
getNumberOfMoves in interface GameFieldcolor - Color to check.
GameField.getNumberOfMoves(int)public float getAvgMoveLength(int color)
GameField
getAvgMoveLength in interface GameFieldcolor - Color to check.
GameField.getAvgMoveLength(int)
public FieldPoint getFieldPoint(int x,
int y)
GameField
getFieldPoint in interface GameFieldx - X point coordinate.y - y point coordinate.
GameField.getFieldPoint(int, int)public int getMaximumXIndex()
GameField
getMaximumXIndex in interface GameFieldGameField.getMaximumXIndex()public int getMaximumYIndex()
GameField
getMaximumYIndex in interface GameFieldGameField.getMaximumYIndex()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||