/* -*- C++ -*- * Copyright ©2005 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ typedef enum { WEST, NORTH, EAST, SOUTH } _Direction; class Direction { public: Direction() : _d(NORTH) { } Direction(int d) : _d(_Direction(d)) { } Direction(const Direction& d) : _d(d._d) { } Direction(const _Direction& d) : _d(d) { } // Default operator= // Default destructor // Default operator== Direction& operator++() { _d = _Direction((int(_d)+1) % 4); return *this; } operator int() const { return int(_d); } private: _Direction _d; };