2 * CS356 Project 01 -- Elevator Simulator
4 * Elevator Class Specification
13 #include "position.hpp"
14 #include "direction.hpp"
18 enum door_status { CLOSED, OPEN };
19 const int elevator_step = 0.1;
21 class bad_direction { };
27 * PURPOSE: Construct a new Elevator object
31 * PROMISE: A new Elevator will be constructed
36 * PURPOSE: Tell the elevator to stop at the given floor,
37 * PURPOSE: going in the given direction.
39 * REQUIRE: floor is a valid floor
40 * REQUIRE: direction is a valid direction
42 * PROMISE: The elevator will stop at the floor when it gets there
44 void stop_at (int floor, enum direction _direction);
47 * PURPOSE: The elevator will move 1/10th of a floor in the current
52 * PROMISE: The elevator will move if it has floors to stop at, otherwise
53 * PROMISE: it will sit idle at its current place.
59 * PURPOSE: Find the direction we should move in
61 * REQUIRE: _direction must be IDLE
63 * PROMISE: The best direction to move will be returned
65 enum direction find_best_direction ();
68 /* Storage for all of the places that we will be stopping */
69 //std::set<Stop> _stops;
70 std::vector<Stop> _stops;
72 /* Storage for the current elevator position */
75 /* Stores the current direction */
76 enum direction _direction;
78 /* Stores the current door status */
79 enum door_status _door_status;
83 #endif /* ELEVATOR_HPP */
85 /* vim: set ts=4 sts=4 sw=4 noexpandtab textwidth=112: */