public class Change1Strategy extends java.lang.Object implements IUpdateStrategy
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Change1Strategy()
Constructor for the strategy.
|
Modifier and Type | Method and Description |
---|---|
void |
updateState(Ball context,
Dispatcher disp)
Run all three composee strategies and if the count goes to zero, change the context's strategy.
|
private IUpdateStrategy s1
private IUpdateStrategy s2
private IUpdateStrategy s3
private int count
public Change1Strategy()
public void updateState(Ball context, Dispatcher disp)
updateState
in interface IUpdateStrategy
context
- The host ball for this strategydisp
- The dispatcher to use if necessary