|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballworld.model.strategy.Change1Strategy
public class Change1Strategy
A composite strategy that switches the context's strategy to a Change2Strategy after a certain number of updates.
Field Summary | |
---|---|
private int |
count
The number of updates before the context's strategy is changed. |
private IUpdateStrategy |
s1
One of the composee strategies |
private IUpdateStrategy |
s2
One of the composee strategies |
private IUpdateStrategy |
s3
One of the composee strategies |
Constructor Summary | |
---|---|
Change1Strategy()
Constructor for the strategy. |
Method Summary | |
---|---|
void |
updateState(Ball context)
Run all three composee strategies and if the count goes to zero, change the context's strategy. |
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 int count
Constructor Detail |
---|
public Change1Strategy()
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 |