2 * CS356 Project 01 -- Elevator Simulator
4 * Position Class Specification
16 * PURPOSE: Construct a new Position object
20 * PROMISE: A new Position object will be created, that
21 * PROMISE: starts at position 0.
26 * PURPOSE: Construct a new Position object
30 * PROMISE: A new Position object will be created, and will
31 * PROMISE: start at position initial_position
33 Position (int initial_position);
36 * PURPOSE: Compare two position objects
38 * REQUIRE: rhs is a valid Position object
40 * PROMISE: True if rhs is at the same position, false otherwise
42 bool operator== (const Position& rhs);
45 * PURPOSE: Compare a Position and a float
49 * PROMISE: True if rhs is within 0.05 of this Position
51 bool operator== (const int rhs);
54 * PURPOSE: Add to this Position
58 * PROMISE: This Position will have the rhs added to it
60 Position& operator+= (const float rhs);
63 * PURPOSE: Subtract from this Position
67 * PROMISE: This Position will have the rhs added to it
69 Position& operator-= (const float rhs);
71 bool operator< (const Position& rhs);
72 bool operator> (const Position& rhs);
74 friend std::ostream& operator<< (std::ostream& os, Position& rhs);
83 #endif /* POSITION_HPP */
85 /* vim: set ts=4 sts=4 sw=4 noexpandtab textwidth=112: */