// ====================================================== // // Represents a Pelican crossing // // ====================================================== #ifndef PELICAN_H #define PELICAN_H #include "Subject.h" class PelicanTimer; class Pelican : public Subject { public: Pelican(); // call when the WAIT button has been pressed void press(void); // states that a Pelican can be in enum PelicanState { RED_STATE, YELLOW_FLASHING, GREEN_TIMING, GREEN_IDLE, YELLOW_STATE }; bool isPressed() const { return pressed; } PelicanState getState() const { return state; } private: // state that this Pelican is in PelicanState state; // called by PelicanTimer when the lights need to change void timerExpired(void); const unsigned int RED_TIME; const unsigned int YELLOW_TIME; const unsigned int GREEN_TIME; const unsigned int FLASH_TIME; // indicates whether the WAIT light should be on bool pressed; // Timer that indicates when the lights should change PelicanTimer *myTimer; private: // prevent general use of copy ctor and operator= Pelican(const Pelican &); Pelican &operator=(const Pelican &); }; #endif