// ferrysimevent.h // ---------------------------------------------------------------------- // // CSE 143 // Homework 4 // http://www.cs.washington.edu/education/courses/143/00su/homework/ // 21 Jul 2000, Ken Yasuhara #ifndef _FERRYSIMEVENT_H_ #define _FERRYSIMEVENT_H_ #include "car.h" #include "ferry.h" class FerrySimEvent { public: enum EventID { CAR_ARRIVAL, // 0 CAR_TICKETING, // 1 CAR_BOARDING, // 2 FERRY_DEPARTURE, // 3 FERRY_ARRIVAL, // 4 }; // constructs an invalid event FerrySimEvent(); FerrySimEvent(const int time, const EventID newID, Car *newCarPtr, Ferry *newFerryPtr); // accessors int getTime() const { return time; } EventID getID() const { return ID; } Car *getCarPtr() const { return carPtr; } Ferry *getFerryPtr() const { return ferryPtr; } // returns 1 if this event should come after otherEvent; // -1 if this event should come before otherEvent; // 0 otherwise, i.e. if this event has the same time and ID as otherEvent int compare(const FerrySimEvent &otherEvent) const; private: int time; EventID ID; Car *carPtr; Ferry *ferryPtr; }; #endif // _FERRYSIMEVENT_H_