#ifndef GAME_OVER_EXCEPTION_H #define GAME_OVER_EXCEPTION_H #include #include using std::string; /** * Generic Exception class */ class RuntimeException { private: string errorMsg; public: RuntimeException(const string& err) { errorMsg = err; } string getMessage() const { return errorMsg; } }; /** * Exception thrown when performing a round on a completed game. */ class GameOverException : public RuntimeException { public: GameOverException(const string& err) : RuntimeException(err) {} }; inline std::ostream& operator<<(std::ostream& out, const RuntimeException& e) { return out << e.getMessage(); } #endif