#ifndef _PARET_HPP #define _PARET_HPP #include class paret { public: enum {NORD, EST, SUD, OEST, NO_DIR}; paret(int p = NO_DIR) throw() : p_(p) {} paret(const string& s) throw() { p_ = NO_DIR; if (s == "nord" || s == "NORD" || s == "N") p_ = NORD; if (s == "est" || s == "EST" || s == "E") p_ = EST; if (s == "sud" || s == "SUD" || s == "S") p_ = SUD; if (s == "oest" || s == "OEST" || s == "W") p_ = OEST; } paret& operator++() throw() { p_ = (p_ == NO_DIR) ? NO_DIR : p_ + 1; return *this; } operator int() const throw() { return p_; } private: int p_; }; #endif