Class DynObject

java.lang.Object
  |
  +--DynObject
All Implemented Interfaces:
DebugInterface
Direct Known Subclasses:
Ball, PlayerInfos

public abstract class DynObject
extends java.lang.Object
implements DebugInterface

This class is used to represent all dynamic objects of the game. For every object the following information is stored:

Version:
1.00
Author:
Daniel Förderer and Moritz Steiner

Field Summary
private  double dirChange
           
private  java.awt.geom.Point2D.Double dirVector
           
private  java.awt.geom.Point2D.Double formerDirVector
           
private  java.awt.geom.Point2D.Double formerPosition
           
private  int formerTime
           
private  java.awt.geom.Point2D.Double position
           
private  double speedChange
           
private  int time
           
 
Fields inherited from interface DebugInterface
DEBUG_SWITCH_STRATEGY_IS_SET, DEBUG_SWITCH_VISUALISATION_IS_SET, DEBUG_SWITCH_WORLDMODEL_AUDIOEVENT_IS_SET, DEBUG_SWITCH_WORLDMODEL_BODYEVENT_IS_SET, DEBUG_SWITCH_WORLDMODEL_VISUALEVENT_IS_SET
 
Constructor Summary
(package private) DynObject(int time, java.awt.geom.Point2D.Double position, java.awt.geom.Point2D.Double formerPosition, java.awt.geom.Point2D.Double dirVector, java.awt.geom.Point2D.Double formerDirVector, double speedChange, double dirChange)
          contructor for a dynamic object with its parameters: position, former position, direction vector, former direction vector, speed change, direction change
 
Method Summary
 double getDirChange()
          gets the direction change of the object
 java.awt.geom.Point2D.Double getDirVector()
          gets the direction vector of the object
 java.awt.geom.Point2D.Double getFormerDirVector()
          gets the former direction vector of the object
 java.awt.geom.Point2D.Double getFormerPosition()
          gets the former position of the object
 java.awt.geom.Point2D.Double getPosition()
          gets the position of the object
 double getSpeedChange()
          gets the speed change of the object
 int getTime()
          gets the timestamp when the object has been perceived
 void print()
          prints all infos of the object usefull for debugging
 void setPosition(double x, double y, char side)
          sets the position of the object, saves the former position and the former direction vector and calculates the actual direction vector, the speed change and the direction change 30.06.2002 added seen, sb
 void setTime(int time)
          sets the timestamp when the object has been perceived
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

time

private int time

formerTime

private int formerTime

position

private java.awt.geom.Point2D.Double position

formerPosition

private java.awt.geom.Point2D.Double formerPosition

dirVector

private java.awt.geom.Point2D.Double dirVector

formerDirVector

private java.awt.geom.Point2D.Double formerDirVector

speedChange

private double speedChange

dirChange

private double dirChange
Constructor Detail

DynObject

DynObject(int time,
          java.awt.geom.Point2D.Double position,
          java.awt.geom.Point2D.Double formerPosition,
          java.awt.geom.Point2D.Double dirVector,
          java.awt.geom.Point2D.Double formerDirVector,
          double speedChange,
          double dirChange)
contructor for a dynamic object with its parameters: position, former position, direction vector, former direction vector, speed change, direction change
Method Detail

getTime

public int getTime()
gets the timestamp when the object has been perceived

setTime

public void setTime(int time)
sets the timestamp when the object has been perceived

getPosition

public java.awt.geom.Point2D.Double getPosition()
gets the position of the object

setPosition

public void setPosition(double x,
                        double y,
                        char side)
sets the position of the object, saves the former position and the former direction vector and calculates the actual direction vector, the speed change and the direction change 30.06.2002 added seen, sb

getFormerPosition

public java.awt.geom.Point2D.Double getFormerPosition()
gets the former position of the object

print

public void print()
prints all infos of the object usefull for debugging

getDirVector

public java.awt.geom.Point2D.Double getDirVector()
gets the direction vector of the object

getFormerDirVector

public java.awt.geom.Point2D.Double getFormerDirVector()
gets the former direction vector of the object

getDirChange

public double getDirChange()
gets the direction change of the object
Returns:
90 if direction changed to the right and -90 if direction changed to the left

getSpeedChange

public double getSpeedChange()
gets the speed change of the object
Returns:
1 if the same speed, <1 if slower, >1 if faster