appletbots
Class WorldObjectData

java.lang.Object
  extended by appletbots.WorldObjectData

public class WorldObjectData
extends java.lang.Object

This object contains the location and velocity values for an object in the world

Author:
Erik Rasmussen

Constructor Summary
WorldObjectData(Point location, Vector velocity, WorldObject object)
          Constructs a new WorldObjectData with the given location and velocity values for the given object
 
Method Summary
 Point getLocation()
          Returns the location of the object.
 WorldObject getObject()
          Returns the object
 Vector getVelocity()
          Returns the velocity of the object.
 void setLocation(Point location)
          Sets the location of the object
 void setVelocity(Vector velocity)
          Sets the velocity of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorldObjectData

public WorldObjectData(Point location,
                       Vector velocity,
                       WorldObject object)
Constructs a new WorldObjectData with the given location and velocity values for the given object

Parameters:
location - The location of the object
velocity - The velocity of the object
object - The object
Method Detail

getLocation

public Point getLocation()
Returns the location of the object. Note that the point returned is a clone of the internal location point, so changing the returned point will not affect the object's location. To modify the object's location, use setLocation(Point).

Returns:
The location of the object

setLocation

public void setLocation(Point location)
Sets the location of the object

Parameters:
location - Sets the location of the object

getVelocity

public Vector getVelocity()
Returns the velocity of the object. Note that the vector returned is a clone of the internal velocity vector, so changing the returned vector will not affect the object's velocity. To modify the object's velocity, use setVelocity(Vector).

Returns:
The velocity of the object

setVelocity

public void setVelocity(Vector velocity)
Sets the velocity of the object

Parameters:
velocity - The velocity of the object

getObject

public WorldObject getObject()
Returns the object

Returns:
The object