ballwar.model.strategy
Class HeavyStrategy

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

public class HeavyStrategy
extends ANoOpStrategy

An ANoOpStrategy-based strategy who initializes its context to have an infinitely large (positive) mass. Thus the velocity of the context is not altered by a collision. Can be combined with RockStrategy to create an immovable object. Warning: infinitely heavy balls continuously add energy into the system, causing the velocitiy of all other balls to increase without an upper bound.


Field Summary
 
Fields inherited from interface ballwar.model.IUpdateStrategy
NullObject
 
Constructor Summary
HeavyStrategy()
           
 
Method Summary
 void init(Ball context)
          Initializes the context's mass to positive infinity.
 
Methods inherited from class ballwar.model.strategy.ANoOpStrategy
kill, updateCollision, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeavyStrategy

public HeavyStrategy()
Method Detail

init

public void init(Ball context)
Initializes the context's mass to positive infinity.

Specified by:
init in interface IUpdateStrategy
Overrides:
init in class ANoOpStrategy
Parameters:
context - The strategy's context.