|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IUpdateStrategy
Interface that represents a strategy used by a Ball when asked to perform variant operations associated with initialization, updating its state, collisions and destruction.
Field Summary | |
---|---|
static IUpdateStrategy |
NullObject
Singleton null object instance of IUpdateStrategy that does nothing. |
Method Summary | |
---|---|
void |
init(Ball context)
Initializes the given ball. |
void |
kill(Ball context)
Processes a "killing" of a ball. |
void |
updateCollision(Ball context,
Ball target)
updates the state of the ball in response to a collision between the two balls. |
void |
updateState(Ball context)
Updates the state of the given ball in response to the periodic repainting of the ball as a part of its animation.. |
Field Detail |
---|
static final IUpdateStrategy NullObject
Method Detail |
---|
void updateState(Ball context)
context
- The ball to update.void updateCollision(Ball context, Ball target)
context
- The ball that just moved and collided with the target ball.target
- The ball that was not moving and was collided by the context.void init(Ball context)
context
- The ball to initialize.void kill(Ball context)
context
- The ball who's kill method was called.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |