|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectballworld.model.strategy.DrunkenStrategy
public class DrunkenStrategy
A strategy that, at every update, randomly selects from a set of 4 strategies to be run.
| Field Summary | |
|---|---|
private IRandomizer |
rand
Randomizer utility used to randomly select one of the possible strategies. |
private IUpdateStrategy |
s1
One of the strategies to choose from |
private IUpdateStrategy |
s2
One of the strategies to choose from |
private IUpdateStrategy |
s3
One of the strategies to choose from |
private IUpdateStrategy |
s4
One of the strategies to choose from |
| Constructor Summary | |
|---|---|
DrunkenStrategy()
Constructor for the strategy. |
|
| Method Summary | |
|---|---|
void |
updateState(Ball context)
Randomly select one of the possible strategies and run it as the strategy for the context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private IUpdateStrategy s1
private IUpdateStrategy s2
private IUpdateStrategy s3
private IUpdateStrategy s4
private IRandomizer rand
| Constructor Detail |
|---|
public DrunkenStrategy()
| Method Detail |
|---|
public void updateState(Ball context)
updateState in interface IUpdateStrategycontext - The host ball for this strategy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||