|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballwar.model.strategy.ANoOpStrategy
ballwar.model.strategy.BreathingStrategy
public class BreathingStrategy
An ANoOpStrategy-based strategy that only only overrides the updateState behavior to make the ball's radius grower larger and smaller in a random sinusoidal manner.
Field Summary | |
---|---|
private static double |
_DeltaLowerLimit
The minumum possible value for the angle increment of the sinusoid between updateState calls, in radians. |
private static double |
_DeltaUpperLimit
The maximum possible value for the angle increment of the sinusoid between updateState calls, in radians. |
private static int |
_MaxRadiusLowerLimit
The minimum possible value for the maximum radius of a ball. |
private static int |
_MaxRadiusUpperLimit
The maximum possible value for the maximum radius of a ball. |
private static int |
_MinRadiusLowerLimit
The minimum possible value for the minumum radius of a ball. |
private static int |
_MinRadiusUpperLimit
The maximum possible value for a ball's minimum radius. |
private IRandomizer |
rand
The Randomizer used to create the random values. |
private SineMaker |
sm
A SineMaker object that creates a sinusoidally varying value. |
Fields inherited from interface ballwar.model.IUpdateStrategy |
---|
NullObject |
Constructor Summary | |
---|---|
BreathingStrategy()
|
Method Summary | |
---|---|
void |
updateState(Ball context)
Sets the ball's radius to the current value returned by the SineMaker object. |
Methods inherited from class ballwar.model.strategy.ANoOpStrategy |
---|
init, updateCollision, updateKill |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int _MinRadiusLowerLimit
private static int _MinRadiusUpperLimit
private static int _MaxRadiusLowerLimit
private static int _MaxRadiusUpperLimit
private static double _DeltaLowerLimit
private static double _DeltaUpperLimit
private IRandomizer rand
private SineMaker sm
Constructor Detail |
---|
public BreathingStrategy()
Method Detail |
---|
public void updateState(Ball context)
updateState
in interface IUpdateStrategy
updateState
in class ANoOpStrategy
context
- The ball who's radius is to be modified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |