|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballworld.model.strategy.WanderStrategy
public class WanderStrategy
Strategy that randomly changes the velocity of the context ball by adding random values to it.
Field Summary | |
---|---|
private int |
delta
The maximum range of the velocity change. |
private IRandomizer |
rand
Randomizer utility for obtaining random values to change the velocity |
Constructor Summary | |
---|---|
WanderStrategy()
|
Method Summary | |
---|---|
void |
updateState(Ball context)
Add random values to both the x and y components of the velocity of hte context ball. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IRandomizer rand
private int delta
Constructor Detail |
---|
public WanderStrategy()
Method Detail |
---|
public void updateState(Ball context)
updateState
in interface IUpdateStrategy
context
- The host ball for this strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |