|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectballworld.model.strategy.CurveStrategy
public class CurveStrategy
Strategy to make the ball curve in a circle
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
CurveStrategy()
|
|
| Method Summary | |
|---|---|
void |
updateState(Ball context)
Rotate the context's velocity by the turning angle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private double angle
private double cosA
private double sinA
| Constructor Detail |
|---|
public CurveStrategy()
| 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 | |||||||||