Use Finite State Machine to manage Elevator movement
[cs356-p1-elevator.git] / stop.hpp
index 21e9ac3..05f672a 100644 (file)
--- a/stop.hpp
+++ b/stop.hpp
 
 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);
-
-               /*
-                * 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);
+               Stop (const Position& position, const Direction& direction);
 
-       private:
-               /* Storage for the floor */
-               Position _floor;
+               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 */