|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PaddleSpecification
Specification of simple paddle behaviour for use in a video game.
For teaching MVC design pattern.
Field Summary | |
---|---|
static boolean |
INVARIANT_OF_CLASS
|
static int |
MAXIMUM_position
The upper bound on the horizontal position of the paddle |
static int |
MINIMUM_position
The lower bound on the horizontal position of the paddle |
Method Summary | |
---|---|
void |
changeDirection()
Changes direction from left to right, or right to left. |
boolean |
equals(java.lang.Object thing)
|
int |
get_position()
|
boolean |
goingRight()
|
java.lang.String |
toString()
|
void |
updatePosition()
Update paddle position or direction of movement: if moving out of defined limits then change the direction of the paddle movement without changing position if moving right inside limits then increment position if moving left inside limits then decrement position |
Field Detail |
---|
static final int MINIMUM_position
static final int MAXIMUM_position
static final boolean INVARIANT_OF_CLASS
Method Detail |
---|
int get_position()
MINIMUM_position
... MAXIMUM_position
boolean goingRight()
void updatePosition()
void changeDirection()
boolean equals(java.lang.Object thing)
equals
in class java.lang.Object
thing
- is the input object to test for equalityjava.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |