|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappletbots.WorldObject
public abstract class WorldObject
This is an abstract class representing an object in the world
Field Summary | |
---|---|
protected java.awt.Color |
color
The object's color |
protected double |
mass
The object's mass |
protected double |
maxSpeed
The object's maximum speed |
protected int |
size
The object's radius |
Constructor Summary | |
---|---|
WorldObject(double mass,
double maxSpeed,
int size,
java.awt.Color color)
Creates a new WorldObject with the given parameters |
Method Summary | |
---|---|
void |
collidedWith(WorldObject object)
Informs the object that it has been in a collision |
java.awt.Color |
getColor()
Returns the object's color |
double |
getMass()
Returns the object's mass |
double |
getMaxSpeed()
Returns the object's maximum speed |
int |
getSize()
Returns the object's radius |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double mass
protected double maxSpeed
protected int size
protected java.awt.Color color
Constructor Detail |
---|
public WorldObject(double mass, double maxSpeed, int size, java.awt.Color color)
mass
- The object's massmaxSpeed
- The object's maximum speedsize
- The object's radiuscolor
- The object's colorMethod Detail |
---|
public final double getMass()
public final double getMaxSpeed()
public final int getSize()
public final java.awt.Color getColor()
public void collidedWith(WorldObject object)
object
- The object collided with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |