X-Git-Url: https://irasnyder.com/gitweb/?a=blobdiff_plain;f=stop.hpp;h=05f672ab1e1de3e6a314c508818340c4aaedcccd;hb=2172ce055533d5865d58538ee00bf609e59b0f99;hp=57839a254b977dcf006ea83d5b77be874ec2d35d;hpb=fb458316875aebf0ab70211d6aac8b3d68556b52;p=cs356-p1-elevator.git diff --git a/stop.hpp b/stop.hpp index 57839a2..05f672a 100644 --- a/stop.hpp +++ b/stop.hpp @@ -10,30 +10,23 @@ #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); - - /* - * 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: + 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 */