ballwar.model.strategy
Class BreathingStrategy

java.lang.Object
  extended by ballwar.model.strategy.ANoOpStrategy
      extended by ballwar.model.strategy.BreathingStrategy
All Implemented Interfaces:
IUpdateStrategy

public class BreathingStrategy
extends ANoOpStrategy

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, kill, updateCollision
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_MinRadiusLowerLimit

private static int _MinRadiusLowerLimit
The minimum possible value for the minumum radius of a ball.


_MinRadiusUpperLimit

private static int _MinRadiusUpperLimit
The maximum possible value for a ball's minimum radius.


_MaxRadiusLowerLimit

private static int _MaxRadiusLowerLimit
The minimum possible value for the maximum radius of a ball.


_MaxRadiusUpperLimit

private static int _MaxRadiusUpperLimit
The maximum possible value for the maximum radius of a ball.


_DeltaLowerLimit

private static double _DeltaLowerLimit
The minumum possible value for the angle increment of the sinusoid between updateState calls, in radians.


_DeltaUpperLimit

private static double _DeltaUpperLimit
The maximum possible value for the angle increment of the sinusoid between updateState calls, in radians.


rand

private IRandomizer rand
The Randomizer used to create the random values.


sm

private SineMaker sm
A SineMaker object that creates a sinusoidally varying value.

Constructor Detail

BreathingStrategy

public BreathingStrategy()
Method Detail

updateState

public void updateState(Ball context)
Sets the ball's radius to the current value returned by the SineMaker object.

Specified by:
updateState in interface IUpdateStrategy
Overrides:
updateState in class ANoOpStrategy
Parameters:
context - The ball who's radius is to be modified.