Threshold code was wrong
[cs356-p1-elevator.git] / elevator.hpp
index de8d71b..0a73480 100644 (file)
@@ -13,6 +13,8 @@
 #include "position.hpp"
 #include "stop.hpp"
 
+class bad_direction { };
+
 typedef std::list<Stop> StopList;
 
 enum State { STATE_IDLE, STATE_UP, STATE_DOWN, STATE_WAIT, STATE_OPEN_DOOR, STATE_CLOSE_DOOR };
@@ -21,14 +23,16 @@ enum Event { EVT_IDLE, EVT_UP, EVT_DOWN, EVT_WAIT, EVT_OPEN_DOOR, EVT_CLOSE_DOOR
 class Elevator
 {
        public:
-               Elevator ();
-               Elevator (int starting_floor);
+               Elevator (int elevator_number);
+               Elevator (int starting_floor, int elevator_number);
 
                void stop_at (Stop &stop);
                float distance_from (Position& pos) const;
                float distance_from (Stop& s) const;
                void move ();
                bool is_idle () const;
+               int getLoad () const;
+               bool willStopAt (int floor, Direction direction) const;
 
        private:
 
@@ -56,6 +60,9 @@ class Elevator
                State state_;
                int wait_;
 
+               /* Elevator Number: Used to make calls into the GUI */
+               int number_;
+
                static const float ELEVATOR_STEP = 0.1;
 };