public class SwitcherStrategy extends java.lang.Object implements IUpdateStrategy
Modifier and Type | Field and Description |
---|---|
private IUpdateStrategy |
_strategy
The decoree strategy.
|
Constructor and Description |
---|
SwitcherStrategy()
Constructor for the strategy.
|
Modifier and Type | Method and Description |
---|---|
void |
setStrategy(IUpdateStrategy newStrategy)
Set the decoree strategy to a new value
|
void |
updateState(Ball context,
Dispatcher disp)
Delegates to the decoree strategy as the context's strategy.
|
private IUpdateStrategy _strategy
public SwitcherStrategy()
public void updateState(Ball context, Dispatcher disp)
updateState
in interface IUpdateStrategy
context
- The host ball for this strategydisp
- The dispatcher to use if necessarypublic void setStrategy(IUpdateStrategy newStrategy)
newStrategy
- The new strategy that wil set.