#ifndef _GAMEEXCEPTION_H_
#define _GAMEEXCEPTION_H_

#include <vector>
#include <ostream>
#include <string>
#include <cstdarg>

enum eErrorSeverity
{
	eMinorError = 0,
	eMajorError,
	eFatalError
};

class GameException
{
	public:
	GameException(const eErrorSeverity &severity, const std::string &str);
	GameException(const eErrorSeverity &severity, const char *str, ...);

	void Output(std::ostream &stream);
	static void OutputLog(std::ostream &stream);
	static bool HasExceptionsToReport() { return (m_sTotalErrors > 0); }

	std::string GetDescription() { return m_str; }
	unsigned long GetTime() { return m_time; }
	eErrorSeverity GetSeverity() { return m_severity; }

	protected:
	std::string ConvertSeverityToString(const eErrorSeverity &severity);
	std::string m_str;
	unsigned long m_time;
	eErrorSeverity m_severity;
	static unsigned int m_sTotalErrors;
	static std::vector<GameException> m_svLog;
};

#endif
