Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Car

    java.lang.Object
      |
      +--Car

All Implemented Interfaces:
  Timed

public class Car
extends java.lang.Object
implements Timed

Field Summary
`protected java.awt.Dimension` | `AREA`
`protected CarGenerator` | `carGenerator`
`protected CarContainer[]` | `carPath`
`static int` | `carRoutes`
`static int` | `carsEntered`
`static int` | `carsExited`
`java.awt.Shape` | `carShape`
`protected double` | `distanceToEnd`
`protected int` | `halflength`
`protected int` | `halfwidth`
`protected int` | `iD`
`protected double[]` | `inFrontInfo`
`protected int` | `length`
`static double` | `metersPerPixel`
`protected double` | `speed`
`protected TimeManager` | `ticker`
`static double` | `timePerTick`
`protected int` | `topspeed`
`protected int` | `width`

Constructor Summary
`Car(LaneSection startLane, CarGenerator parent, TimeManager theTick, int topspeed)`

Method Summary
`float` | `centerX()`
`float` | `centerY()`
`boolean` | `checkSetUp()`
`boolean` | `collide(Car target)`
`void` | `drawCar(java.awt.Graphics2D g2d)`
`void` | `drawGhostCar(java.awt.Graphics2D g2d)`
`java.lang.String` | `getDistanceToNext()`
`java.awt.Shape` | `getFuturePath()` Shows the path that the car has planned to take
`java.lang.String` | `getSpeedOfNext()`
`java.lang.String` | `getSpeedString()`
`void` | `pretick()`
`void` | `removefromTimer()`
`void` | `setNewPosition(double speed, double angle)`
`void` | `tick()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### timePerTick

    public static final double timePerTick

### metersPerPixel

    public static final double metersPerPixel

### carRoutes

    public static final int carRoutes

### carsEntered

    public static int carsEntered

### carsExited

    public static int carsExited

### carGenerator

    protected CarGenerator carGenerator

### ticker

    protected TimeManager ticker

### carPath

    protected CarContainer[] carPath

### AREA

    protected java.awt.Dimension AREA

### width

    protected int width

### length

    protected int length

### halfwidth

    protected int halfwidth

### halflength

    protected int halflength

### carShape

    public java.awt.Shape carShape

### distanceToEnd

    protected double distanceToEnd

### speed

    protected double speed

### topspeed

    protected int topspeed

### inFrontInfo

    protected double[] inFrontInfo

### iD

    protected int iD

Constructor Detail

### Car

    public Car(LaneSection startLane,
               CarGenerator parent,
               TimeManager theTick,
               int topspeed)

Method Detail

### checkSetUp

    public boolean checkSetUp()

### centerX

    public float centerX()

### centerY

    public float centerY()

### removefromTimer

    public void removefromTimer()

### drawCar

    public void drawCar(java.awt.Graphics2D g2d)

### getDistanceToNext

    public java.lang.String getDistanceToNext()

### getSpeedOfNext

    public java.lang.String getSpeedOfNext()

### drawGhostCar

    public void drawGhostCar(java.awt.Graphics2D g2d)

### pretick

    public void pretick()

  Specified by:
    `pretick` in interface `Timed`

### tick

    public void tick()

  Specified by:
    `tick` in interface `Timed`

### collide

    public boolean collide(Car target)

### getSpeedString

    public java.lang.String getSpeedString()

### setNewPosition

    public void setNewPosition(double speed,
                               double angle)

### getFuturePath

    public java.awt.Shape getFuturePath()

  Shows the path that the car has planned to take

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD