|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
infpp.oceanlife.OceanObject
infpp.oceanlife.OilBlob
public class OilBlob
Implements objects of the type oil blob. The coordinates and the icon are given from the super class "OceanObject". The movement direction is defined here.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private int |
dir0
Sets the width of the x-direction of the bubble's movement. |
private int |
dir1
Sets the amplitude of the x-direction of the bubble's movement. |
private int |
dir2
Sets the width of the y-direction of the bubble's movement. |
private int |
dir3
Sets the amplitude of the y-direction of the bubble's movement. |
Fields inherited from class infpp.oceanlife.OceanObject |
---|
COLLISION_LEFT_BOUND, COLLISION_LOWER_BOUND, COLLISION_RIGHT_BOUND, COLLISION_UPPER_BOUND, currentOcean, direction, id, myID, NO_COLLISION |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
OilBlob(int x,
int y,
javax.swing.ImageIcon oilBlobIcon,
Ocean currentOcean)
|
Method Summary | |
---|---|
java.lang.String |
toString()
|
protected void |
updateDirection()
Updates the oil blob's direction vector Switch statement for the cases when the oil blob collides with the ocean bounds. |
Methods inherited from class infpp.oceanlife.OceanObject |
---|
getDimensionsOfIcon, getObjectIcon, getObjectID, getObjectIDString, getPosition, getPositionX, getPositionY, getUniqueOceanObjectID, isHighlighted, isToDie, objectCollidesWithOceanBounds, run, setHighlighted, setObjectIcon, setPositionWhenAdding, setPositionWhenMoving, setToDie |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int dir0
private int dir1
private int dir2
private int dir3
Constructor Detail |
---|
public OilBlob(int x, int y, javax.swing.ImageIcon oilBlobIcon, Ocean currentOcean) throws java.lang.Exception
x
- the oil blob's x coordinatey
- the oil blob's y coordinatecurrentOcean
- the ocean the oil blob resides in
throws
- exception for the position
java.lang.Exception
Method Detail |
---|
protected void updateDirection()
updateDirection
in class OceanObject
public java.lang.String toString()
toString
in class OceanObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |