appletbots
Class CarriableObject

java.lang.Object
  extended by appletbots.WorldObject
      extended by 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

Field Summary
 
Fields inherited from class appletbots.WorldObject
color, mass, maxSpeed, size
 
Constructor Summary
CarriableObject(double mass, double maxSpeed, int size, java.awt.Color color)
          Creates a new CarriableObject with the given parameters
 
Method Summary
 CarrierAgent getCarriedBy()
          Returns the agent carrying the object
 boolean isCarried()
          Returns whether or not the object is being carried
 void setCarriedBy(CarrierAgent carriedBy)
          Informs the object about who is carrying it
 
Methods inherited from class appletbots.WorldObject
collidedWith, getColor, getMass, getMaxSpeed, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 mass
maxSpeed - The object's maximum speed
size - The object's radius
color - The object's color
Method Detail

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