public class CokeCan extends OceanObject
Modifier and Type | Field and Description |
---|---|
private CokeCanBubbleGeneratorThread |
ccbgt
The ccbgt.
|
private java.lang.Boolean |
hasReachedBottom
The has reached bottom.
|
private static long |
serialVersionUID
The Constant serialVersionUID.
|
direction, KEINE_KOLLISION, KOLLISION_LINKS, KOLLISION_OBEN, KOLLISION_RECHTS, KOLLISION_UNTEN, rand, toppledLeft, toppledRight, upright
Constructor and Description |
---|
CokeCan(int ID,
java.lang.String name,
int[] position,
OceanInterface ocean,
int maximumAge)
Instantiates a new coke can.
|
Modifier and Type | Method and Description |
---|---|
CokeCanBubbleGeneratorThread |
getCcbgt()
Gets the CokeCanBubbleGeneratorThread.
|
java.lang.Boolean |
hasReachedBottom()
Checks for reached bottom.
|
void |
reaktion(OceanObject obj2)
This method describes the way an object reacts after a collision.
|
void |
setCcbgt(CokeCanBubbleGeneratorThread ccbgt)
Sets the ccbgt.
|
void |
setHasReachedBottom(java.lang.Boolean hasReachedBottom)
Sets the checks for reached bottom.
|
protected void |
updateDirectionWhenCollidingWithOceanBounds(int collisionDetected)
Describes the way an objects reacts with the oceans bounds.
|
collidesWithOceanBounds, crushLowerObject, decHunger, getAge, getDimensionsOfIcon, getDirection, getDirectionString, getDirectionX, getDirectionY, getHunger, getIcon, getID, getMaximumAge, getMyOcean, getOceanObjectName, getPosition, getPositionString, getPositionX, getPositionY, getRand, getTagged, getToppledLeft, getToppledRight, getType, getUpright, getxDirConst, getxDirVar, getyDirConst, getyDirVar, incHunger, meBounce, move, movementCollisionTwo, RectangleIntersect, setAge, setDirection, setDirectionX, setDirectionY, setHunger, setIcon, setIcon, setID, setMaximumAge, setMyOcean, setOceanObjectName, setPosition, setPositionX, setPositionY, setRand, setTagged, setToppledLeft, setToppledRight, setType, setUpright, setxDirConst, setxDirVar, setyDirConst, setyDirVar, topple, toppleLeft, toppleRight, toString, youBounce
private static final long serialVersionUID
private CokeCanBubbleGeneratorThread ccbgt
private java.lang.Boolean hasReachedBottom
public CokeCan(int ID, java.lang.String name, int[] position, OceanInterface ocean, int maximumAge) throws java.lang.Exception
ID
- the idname
- the nameposition
- the positionocean
- the oceanmaximumAge
- the maximum agejava.lang.Exception
- the exceptionpublic CokeCanBubbleGeneratorThread getCcbgt()
public void setCcbgt(CokeCanBubbleGeneratorThread ccbgt)
ccbgt
- the new ccbgtpublic java.lang.Boolean hasReachedBottom()
public void setHasReachedBottom(java.lang.Boolean hasReachedBottom)
hasReachedBottom
- the hasReachedBottom to setpublic void reaktion(OceanObject obj2)
reaktion
in class OceanObject
obj2
- the second one of the collisionprotected void updateDirectionWhenCollidingWithOceanBounds(int collisionDetected)
updateDirectionWhenCollidingWithOceanBounds
in class OceanObject
collisionDetected
- is a collision detected