|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents field for soccer game.
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 |
public void makeMove(Move move, int color) throws InvalidMoveException
move
- Move that will be made.color
- Color for the new move.
InvalidMoveException
- Thrown when move is invalid
for current game field state.public java.awt.Point getCurrentPosition()
public void startGame()
public boolean isGameOver()
public boolean isDeadLock()
public int isGoal()
public int getNumberOfMoves(int color)
color
- Color to check.
public float getAvgMoveLength(int color)
color
- Color to check.
public FieldPoint getFieldPoint(int x, int y)
x
- X point coordinate.y
- y point coordinate.
public int getMaximumXIndex()
public int getMaximumYIndex()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |