Class Evolution.Hazard

java.lang.Object
  extended by Evolution.Drawable
      extended by Evolution.Hazard
Enclosing class:
Evolution

private class Evolution.Hazard
extends Evolution.Drawable


Field Summary
 double direction
           
 int range
           
 double strength
           
 Evolution.HazardType type
           
 
Fields inherited from class Evolution.Drawable
id, positionX, positionY, sprite
 
Constructor Summary
Evolution.Hazard(Evolution.HazardType type)
          Use all the defaults
 
Method Summary
 boolean affectAnimal(Evolution.Animal a, double dX, double dY)
          Affect an animal
 void die()
           
 void drawSprite()
          Override drawSprite() so we can set the hazard into the background pixels
 int getDirection()
           
 void initialize(java.lang.Double positionX, java.lang.Double positionY, Evolution.HazardType type, java.lang.Double strength, java.lang.Double direction, java.lang.Integer range)
          Initialize this object's member variables
 void setDirection(int direction)
           
 java.lang.String toString()
           
 void wipeSprite()
          Overload of wipeSprite, using the default pixel arrays.
 
Methods inherited from class Evolution.Drawable
drawSprite, drawSprite, getPositionX, getPositionY, getSprite, setPositionX, setPositionY, setSprite, wipeSprite, wrapPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

public Evolution.HazardType type

strength

public double strength

direction

public double direction

range

public int range
Constructor Detail

Evolution.Hazard

public Evolution.Hazard(Evolution.HazardType type)
Use all the defaults

Method Detail

initialize

public void initialize(java.lang.Double positionX,
                       java.lang.Double positionY,
                       Evolution.HazardType type,
                       java.lang.Double strength,
                       java.lang.Double direction,
                       java.lang.Integer range)
Initialize this object's member variables


affectAnimal

public boolean affectAnimal(Evolution.Animal a,
                            double dX,
                            double dY)
Affect an animal


drawSprite

public void drawSprite()
Override drawSprite() so we can set the hazard into the background pixels

Overrides:
drawSprite in class Evolution.Drawable

wipeSprite

public void wipeSprite()
Description copied from class: Evolution.Drawable
Overload of wipeSprite, using the default pixel arrays.

Overrides:
wipeSprite in class Evolution.Drawable

die

public void die()
Overrides:
die in class Evolution.Drawable

getDirection

public int getDirection()

setDirection

public void setDirection(int direction)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object