BUGFIX: Elevators did not handle Requests in the correct order
[cs356-p1-elevator.git] / stop.hpp
index c7256bc..05f672a 100644 (file)
--- a/stop.hpp
+++ b/stop.hpp
 #include "position.hpp"
 #include "direction.hpp"
 
-class Stop : public Position
+class Stop
 {
+       friend std::ostream& operator<< (std::ostream &os, const Stop& rhs);
+
        public:
-               /* PURPOSE: Construct a new Stop object, and set the floor and direction
-                *
-                * REQUIRE: Nothing
-                *
-                * PROMISE: A new Stop object will be created
-                */
-               Stop (int floor, enum direction mydirection);
-
-
-               Stop (Position pos, enum direction mydirection);
-
-               /*
-                * PURPOSE: Check if this and another Stop object is equivalent
-                *
-                * REQUIRE: rhs is a valid Stop object
-                *
-                * PROMISE: Return true if this and rhs are equivalent, false otherwise
-                */
-               bool operator== (Stop& rhs);
-               friend std::ostream& operator<< (std::ostream& os, Stop& rhs);
+               Stop (const Position& position, const Direction& direction);
 
-       private:
+               bool operator== (const Stop& rhs) const;
+               bool operator< (const Stop& rhs) const;
+               bool operator> (const Stop& rhs) const;
 
-               /* Storage for the direction */
-               enum direction _direction;
+               const Direction getDirection () const;
+               const Position getPosition () const;
+
+       private:
+               Position        position_;
+               Direction       direction_;
 };
 
 #endif /* STOP_HPP */