public class WanderStrategy extends java.lang.Object implements IUpdateStrategy
| Modifier and Type | Field and Description |
|---|---|
private int |
delta
The maximum range of the velocity change.
|
private IRandomizer |
rand
Randomizer utility for obtaining random values to change the velocity
|
| Constructor and Description |
|---|
WanderStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
updateState(Ball context,
Dispatcher disp)
Add random values to both the x and y components of the velocity of hte context ball.
|
private IRandomizer rand
private int delta
public void updateState(Ball context, Dispatcher disp)
updateState in interface IUpdateStrategycontext - The host ball for this strategydisp - The dispatcher to use if necessary