public interface OceanInterface
Modifier and Type | Method and Description |
---|---|
void |
addOceanObject(OceanObject obj)
With this method, you add a new object to the
OceanObjectList (also to the ocean).
|
java.lang.Boolean |
contains(OceanObject o) |
int |
getAnimationDelay() |
int |
getDepth() |
MovementThread |
getMovementThread()
Gets the movement thread
|
int |
getNumberOfOceanObjectsByType(int type) |
java.util.LinkedList<OceanObject> |
getOceanObjects() |
Pair<java.lang.Integer,java.lang.Integer> |
getStatusPanelInfo() |
int |
getWidth() |
boolean |
isOceanRunning() |
java.lang.Boolean |
load(java.lang.String path,
java.io.File name) |
void |
move()
This method moves all the ocean's objects.
|
java.lang.Boolean |
positionOccupied(OceanObject o)
Determines whether the position of the object o is occupied
(i.e. whether the object o can be added there).
|
void |
removeAllObjects()
This method removes all objects from the OceanObjectList.
|
void |
removeAllTaggedObjects()
This method removes all tagged objects from the OceanObjectList.
|
void |
removeOceanObject(OceanObject o)
This method removes a specific object from the OceanObjectList.
|
java.lang.Boolean |
save(java.lang.String path,
java.io.File name)
This method saves an ocean to a file.
|
void |
setAnimationDelay(int currentDelay)
This method sets the delay between two steps of the animation.
|
void |
setDepth(int depth)
This method sets the ocean's depth.
|
void |
setMovementThread(MovementThread mt)
This method sets the movement thread
|
void |
setOceanObjects(java.util.LinkedList<OceanObject> oceanObjects)
This method sets the ocean object list.
|
void |
setWidth(int width)
This method sets the ocean's width.
|
void |
start()
This method starts the movement.
|
void |
stop()
This method stops the movement, all objects in the list freeze in the
current position.
|
void addOceanObject(OceanObject obj) throws Ocean.PositionOccupiedException, Ocean.PositionOutOfBoundsException
obj
- Ocean.PositionOccupiedException
- if the position is occupiedOcean.PositionOutOfBoundsException
- if the position is out of boundsjava.lang.Boolean contains(OceanObject o)
o
- the ocean object to be addedint getAnimationDelay()
int getDepth()
MovementThread getMovementThread()
int getNumberOfOceanObjectsByType(int type)
type
- the type of ocean object to countjava.util.LinkedList<OceanObject> getOceanObjects()
Pair<java.lang.Integer,java.lang.Integer> getStatusPanelInfo()
int getWidth()
boolean isOceanRunning()
java.lang.Boolean load(java.lang.String path, java.io.File name)
path
- the location of the ocean to loadname
- the ocean's file namevoid move() throws java.lang.Exception
java.lang.Exception
- hands exception received from the
addNewlySpawnedObjects() method to the controllerjava.lang.Boolean positionOccupied(OceanObject o)
o
- an ocean object to be addedvoid removeAllObjects()
void removeAllTaggedObjects() throws Ocean.EmptyListException
Ocean.EmptyListException
- if no objects have been selected for removal.void removeOceanObject(OceanObject o)
o
- the ocean object to be removedjava.lang.Boolean save(java.lang.String path, java.io.File name)
path
- the location to save the ocean atname
- the file name for the oceanvoid setAnimationDelay(int currentDelay)
currentDelay
- the animation delay to setvoid setDepth(int depth)
depth
- the depth to setvoid setMovementThread(MovementThread mt)
mt
- the movement thread to setvoid setOceanObjects(java.util.LinkedList<OceanObject> oceanObjects)
oceanObjects
- the list of all OceanObjects in the ocean.void setWidth(int width)
width
- the oceans widthvoid start()
void stop()