appletbots
Class CarriableObject
java.lang.Object
appletbots.WorldObject
appletbots.CarriableObject
- Direct Known Subclasses:
- Food
public abstract class CarriableObject
- extends WorldObject
This class represents an object that can be picked up in the appletbots
world.
- Author:
- Erik Rasmussen
Constructor Summary |
CarriableObject(double mass,
double maxSpeed,
int size,
java.awt.Color color)
Creates a new CarriableObject with the given parameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CarriableObject
public CarriableObject(double mass,
double maxSpeed,
int size,
java.awt.Color color)
- Creates a new CarriableObject with the given parameters
- Parameters:
mass
- The object's massmaxSpeed
- The object's maximum speedsize
- The object's radiuscolor
- The object's color
isCarried
public boolean isCarried()
- Returns whether or not the object is being carried
- Returns:
- Whether or not the object is being carried
setCarriedBy
public void setCarriedBy(CarrierAgent carriedBy)
- Informs the object about who is carrying it
- Parameters:
carriedBy
- The agent carrying the object
getCarriedBy
public CarrierAgent getCarriedBy()
- Returns the agent carrying the object
- Returns:
- The agent carrying the object