Class SlowFish

  extended by
      extended by
          extended by
All Implemented Interfaces:
java.lang.Cloneable, java.util.Observer

public class SlowFish
extends GenericFish

Class for a slow fish.

Mathias G. Ricken

Field Summary
private  double _probOfMoving
          Probability that this slow fish moves.
Fields inherited from class
_fishColor, _fishDisplay, _probOfBreeding, _probOfDying
Constructor Summary
SlowFish(java.awt.Color fishColor)
          Create a new slow fish.
Method Summary
 void move()
          Execute the movement part of a simulation step.
 void paint(java.awt.Graphics2D g, java.awt.Component comp)
          Draw the fish.
Methods inherited from class
act, age, breed, clone, die, draw, getColor, setLocalEnvironment, setProbOfBreeding, setProbOfDying, toString, tryBreedFwd, tryMoveFwd, turnLeft, turnLeft, turnRight, turnRight, update
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


private double _probOfMoving
Probability that this slow fish moves.

Constructor Detail


public SlowFish(java.awt.Color fishColor)
Create a new slow fish.

fishColor - color of the fish
Method Detail


public void move()
Execute the movement part of a simulation step.

move in class GenericFish


public void paint(java.awt.Graphics2D g,
                  java.awt.Component comp)
Draw the fish. The Graphics2D object has been translated, rotated and scaled so that the origin is in the center of the fish. The fish should just be drawn from (-0.5, -0.5) to (0.5, 0.5).

paint in class AFish
g - graphics object to drawFish on.
comp - the component to drawFish on