// File: Car.h // // Skeleton file for Car class // Add members as needed. // #ifndef CAR_H #define CAR_H #include "Thing.h" class RaceCourse ; class Car : public Thing { public: // Default Constructor, not very interesting Car() ; // Alternate constructor. Initializes a Car with given position. // 'label' is the character to be returned by DrawMe(). // 'fuel' is the initial fuel level. // Car(unsigned int row, unsigned int col, char label, unsigned int fuel) ; // Zooming, pretty much the same requirements as in Project 2. // The Car should move in the direction specified for as many cells // as possible, until it runs out of few or bumps into something. // If it bumps into X, then X.encounter() should be called. // Help is needed from the RaceCourse member functions. // virtual void ZoomLeft() ; virtual void ZoomRight() ; virtual void ZoomUp() ; virtual void ZoomDown() ; // Crash management. // This is what happens when some other Car crashes into the current // one. void encounter(Car *ptr) ; // Fuel management // // Return current fuel level unsigned int GetFuelLevel() const ; // Set the fuel level to f. void SetFuelLevel(unsigned int f) ; // Add inc to the current fuel level void IncFuelLevel(unsigned int inc) ; // Subtract dec to the current fuel level. // Note: the fuel level should never be negative. void DecFuelLevel(unsigned int dec) ; // Race Course stuff // As described in Thing.h virtual char DrawMe() const ; //------------------------------------------------------------ // You may need to add more member functions and/or data members protected: //------------------------------------------------------------ // You may need to add more member functions and/or data members private: //------------------------------------------------------------ // You may need to add more member functions and/or data members } ; #endif