ppJava.serie04.oceanlife
Class Fish

java.lang.Object
  extended by ppJava.serie04.oceanlife.OceanObject
      extended by ppJava.serie04.oceanlife.Fish
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public class Fish
extends OceanObject

A fish, swimming in the ocean

Author:
ken, bpei
See Also:
Serialized Form

Field Summary
(package private)  java.lang.String imageNormalResource
           
(package private)  java.lang.String imageReversedResource
           
(package private)  int[] imageSizes
           
(package private)  int paddingBorder
           
(package private)  int randomSprite
           
private static long serialVersionUID
           
 
Constructor Summary
Fish(int x, int y)
          Constructor for a fish at position (x,y)
 
Method Summary
 void changeDirections(OceanObject tempRefObject)
          Change the directions and turn around the image
 void flipImage()
          Turn around the image
 void run()
          The movement of a fish
 java.lang.String toString()
           
 
Methods inherited from class ppJava.serie04.oceanlife.OceanObject
calcAbsDistance, checkBarrier, checkPosition, createImageIcon, genRandomVector, getBarrier, getBorders, getClassName, getDiffVector, getDistance, getImageIcon, getImageResource, getImageSize, getMoveVector, getObjectCount, getOffset, getPosition, hasSameDirection, incPosX, incPosY, isVulnerableTo, moveStep, normalizeImage, setBarrier, setBorders, setImageIcon, setImageResource, setImageSize, setMoveVector, setOffset, setPosition, switchMovementDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

randomSprite

int randomSprite

imageSizes

int[] imageSizes

imageNormalResource

java.lang.String imageNormalResource

imageReversedResource

java.lang.String imageReversedResource

paddingBorder

int paddingBorder
Constructor Detail

Fish

public Fish(int x,
            int y)
Constructor for a fish at position (x,y)

Parameters:
x -
y -
Method Detail

toString

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

flipImage

public void flipImage()
Turn around the image


changeDirections

public void changeDirections(OceanObject tempRefObject)
Change the directions and turn around the image

Overrides:
changeDirections in class OceanObject

run

public void run()
The movement of a fish