public class CurveStrategy extends java.lang.Object implements IUpdateStrategy
| Modifier and Type | Field and Description |
|---|---|
private double |
angle
Random turning angle
|
private double |
cosA
Pre-calculated cosine of the turning angle
|
private double |
sinA
Pre-calculated sine of the turning angle
|
| Constructor and Description |
|---|
CurveStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
updateState(Ball context,
Dispatcher disp)
Rotate the context's velocity by the turning angle
|
private double angle
private double cosA
private double sinA
public void updateState(Ball context, Dispatcher disp)
updateState in interface IUpdateStrategycontext - The host ball for this strategydisp - The dispatcher to use if necessary