#pragma once #include #include enum class DirT{UP, DOWN, LEFT, RIGHT, UP_LEFT, UP_RIGHT, DOWN_LEFT, DOWN_RIGHT, NEXT, BACK, NONE}; const std::vector DIRECTION_NAMES{"up","down","left","right", "up left", "up right", "down left", "down right", "next", "back", "none"}; const int DIRECTION_COUNT{static_cast(DirT::NONE)}; std::string DirTToString(DirT dir); DirT StringToDirT(std::string name); DirT NextDir(DirT dir); // forward declaration, can't be used in a system without a BoardT. class BoardT; class CoordT { public: CoordT(const BoardT & b, std::size_t xpos =0, std::size_t ypos = 0); CoordT(const CoordT & other); CoordT & operator = (const CoordT & other); std::size_t X() const; std::size_t Y() const; void Change(DirT direction); void Set(std::size_t xpos, std::size_t ypos); bool SuccessfulChange() const; private: const BoardT & board; std::size_t x, y; bool error; friend class BoardT; };