objects
Class MovingObject
java.lang.Object
|
+--objects.WhatWhere
|
+--objects.MovingObject
- All Implemented Interfaces:
- Extensible, Locatable, Movable, Serializable
- public class MovingObject
- extends WhatWhere
- implements Movable
This class is intended to be the the basis for moving physical
objects in the world. It provides methods for update the location
of the object. The Mover class uses the Movable provided and
updates its location via setLoc calls.
- Version:
- $Revision: 1.5 $
- Author:
- Dave Jurgens
- See Also:
- Serialized Form
|
Constructor Summary |
MovingObject(double xcoord,
double ycoord,
double width,
double height)
|
MovingObject(double xcoord,
double ycoord,
double width,
double height,
objects.Mover mover)
|
MovingObject(objects.Location loc,
objects.Dimension dim)
|
MovingObject(objects.Location loc,
objects.Dimension dim,
objects.Mover mover)
|
|
Method Summary |
double |
getMovementRate()
|
boolean |
isMoving()
|
void |
setLoc(double xcoord,
double ycoord)
Sets the location of this object to the coordinate arguments. |
void |
setLoc(objects.Location loc)
Sets the location of this object to loc. |
void |
startMoving(objects.Mover mover)
|
void |
stopMoving()
|
| Methods inherited from class objects.WhatWhere |
bound, getCenter, getDimensions, getDistance, getHeight, getLoc, getWidth, isEastOf, isNorthOf, isSouthOf, isWestOf, overlaps |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
mover
protected objects.Mover mover
MovingObject
public MovingObject(objects.Location loc,
objects.Dimension dim,
objects.Mover mover)
MovingObject
public MovingObject(objects.Location loc,
objects.Dimension dim)
MovingObject
public MovingObject(double xcoord,
double ycoord,
double width,
double height,
objects.Mover mover)
MovingObject
public MovingObject(double xcoord,
double ycoord,
double width,
double height)
setLoc
public void setLoc(objects.Location loc)
- Description copied from interface:
Movable
- Sets the location of this object to loc.
- Specified by:
setLoc in interface Movable
setLoc
public void setLoc(double xcoord,
double ycoord)
- Description copied from interface:
Movable
- Sets the location of this object to the coordinate arguments.
- Specified by:
setLoc in interface Movable
startMoving
public void startMoving(objects.Mover mover)
stopMoving
public void stopMoving()
isMoving
public boolean isMoving()
getMovementRate
public double getMovementRate()
To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.