#include <list>
#include <bool.h>
#include "vector.h"

class Plane {
 private:
  
  // ... UP TO YOU

 public:
  // These constructors enforce that a plane must have a number
  // and a position.
  Plane(istream& i); // input data from cin
  // new plane coming in from left or right side
  // relativeHeight is a float >0 <1 that determines the height
  // direction is an angle that determines the initial range
  // as well as the direction
  Plane(int num, float direction, float relativeHeight); // NEW
  // Deprecated == removed from service
  // Plane(int num, Coord initial-position); // DEPRECATED

  // Access methods
  int getNumber() const; 
  float getSpeed() const;
  float getDirection() const;
  bool outOfRange() const;   // is the plane out of range?
  Coord getPosition() const; // NEW
  bool getProximity() const; // NEW - is the proximity alarm on?
  bool crashed() const; // NEW - has the plane crashed?
  list<Plane *> getClosePlanes() const; // NEW

  // returns the plane's coordinates in a window of width,height
  // implementing this method will be lab 10
  Coord transformCoordinates(Coord) const; // NEW

  // set the velocity
  void setSpeed(float);
  void setDirection(float);

  // returns the next position - Does not set new position
  Coord computeNextPosition() const;
  void setNextPosition();

  // may put planes on nearbyPlanes list, or take some off.
  // may set proximityalarm.  NEW - May set crashed flag.
  void checkProximity(list<Plane*>); 

  // Normally called when a plane is tooclose to another
  // Prompts the user - NOT for new values for speed & dir, but for *changes* 
  // to the values.  Define constants for the class that sets the maximum
  // change to speed and direction within one call.  Prompts repeatedly until
  // a value in the range is entered.
  void changeVelocity(); // NEW

  // draw the plane in its current position (unless crashed or outOfRange)
  // PRE: window must be width x height
  // this method will be provided to you.
  void display(int windowWidth, int windowHeight) const; // NEW
};

// prototype for output op, doesn't need to be a friend -
// NEW - use only the public access methods for Planes
ostream& operator<<(ostream& o, Plane* p);

// Plane pointer list iterator types
typedef list<Plane*>::const_iterator constPlaneItor;
typedef list<Plane*>::iterator planeItor;

