fishbowl.strategy
Class Fish

java.lang.Object
  extended by cse115.graphics.AbstractGraphic
      extended by cse115.graphics.AbstractColorableGraphic
          extended by cse115.graphics.Polygon
              extended by fishbowl.Fish
                  extended by fishbowl.strategy.Fish
All Implemented Interfaces:
CenterLocatable, Colorable, ColorableGraphic, Graphic, Locatable, Rotatable, Sizeable, Observer

public class Fish
extends Fish

TODO: fill in comments for Fish

Author:
Adrienne M Decker Created on: Oct 19, 2006

Constructor Summary
Fish()
          Creates a new instance of Fish
 
Method Summary
 IFishBehavior getBehavior()
           
 void setBehavior(IFishBehavior beh)
           
 void update()
          Update the position and orientation of the fish based on the velocity.
 
Methods inherited from class fishbowl.Fish
getDx, getDy, getSize, getVector, setSize, setVector, update
 
Methods inherited from class cse115.graphics.Polygon
actualPaint, addPoint, getLocation, getShape, move, removePoint, setDimension, setLocation
 
Methods inherited from class cse115.graphics.AbstractColorableGraphic
getColor, paint, setColor
 
Methods inherited from class cse115.graphics.AbstractGraphic
addMouseListener, addMouseMotionListener, contains, getBounds, getCenterLocation, getContainer, getDimension, getMouseListeners, getMouseMotionListeners, getRotation, intersects, rotate, setCenterLocation, setContainer, setRotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cse115.graphics.Graphic
addMouseListener, addMouseMotionListener, contains, getBounds, getMouseListeners, getMouseMotionListeners, intersects, setContainer
 
Methods inherited from interface cse115.graphics.Sizeable
getDimension
 
Methods inherited from interface cse115.graphics.CenterLocatable
getCenterLocation, setCenterLocation
 
Methods inherited from interface cse115.graphics.Rotatable
getRotation, rotate, setRotation
 

Constructor Detail

Fish

public Fish()
Creates a new instance of Fish

Method Detail

setBehavior

public void setBehavior(IFishBehavior beh)

getBehavior

public IFishBehavior getBehavior()

update

public void update()
Description copied from class: Fish
Update the position and orientation of the fish based on the velocity. If the fish hits a wall, it reverses velocity in the appropriate direction and points in the appropriate direction too.

Overrides:
update in class Fish