ballworld.model.strategy
Class BreathingStrategy

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

public class BreathingStrategy
extends java.lang.Object
implements IUpdateStrategy

Strategy to change the context ball's radius in a random sinusoidal manner

Author:
swong

Field Summary
private  IRandomizer rand
          Randomizer utility for setting the sinusoid.
private  SineMaker sm
          Sinusoid generator, randomly initialized.
 
Constructor Summary
BreathingStrategy()
           
 
Method Summary
 void updateState(Ball context)
          Set the context's radius to the next value in the sinusoid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rand

private IRandomizer rand
Randomizer utility for setting the sinusoid.


sm

private SineMaker sm
Sinusoid generator, randomly initialized.

Constructor Detail

BreathingStrategy

public BreathingStrategy()
Method Detail

updateState

public void updateState(Ball context)
Set the context's radius to the next value in the sinusoid.

Specified by:
updateState in interface IUpdateStrategy
Parameters:
context - The host ball for this strategy