2 * Copyright (c) 2002 Erik Rasmussen - All Rights Reserverd
9 * This is an abstract class representing an object in the world
11 * @author Erik Rasmussen
13 public abstract class WorldObject
18 protected double mass
;
20 * The object's maximum speed
22 protected double maxSpeed
;
30 protected Color color
;
33 * Creates a new WorldObject with the given parameters
35 * @param mass The object's mass
36 * @param maxSpeed The object's maximum speed
37 * @param size The object's radius
38 * @param color The object's color
40 public WorldObject(final double mass
, final double maxSpeed
, final int size
, final Color color
)
43 this.maxSpeed
= maxSpeed
;
49 * Returns the object's mass
51 * @return The object's mass
53 public final double getMass()
59 * Returns the object's maximum speed
61 * @return The object's maximum speed
63 public final double getMaxSpeed()
69 * Returns the object's radius
71 * @return The object's radius
73 public final int getSize()
79 * Returns the object's color
81 * @return The object's color
83 public final Color
getColor()
89 * Informs the object that it has been in a collision
91 * @param object The object collided with
93 public void collidedWith(final WorldObject object
)