metaforce/Runtime/CIOWin.hpp

32 lines
819 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-18 05:54:43 +00:00
#include <functional>
#include <memory>
#include <string>
2015-08-20 02:52:07 +00:00
#include "Runtime/RetroTypes.hpp"
2016-08-05 23:48:53 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
2015-08-22 01:58:41 +00:00
class CArchitectureMessage;
class CArchitectureQueue;
2015-08-18 05:54:43 +00:00
2018-12-08 05:30:43 +00:00
class CIOWin {
std::string x4_name;
size_t m_nameHash;
2015-08-20 02:52:07 +00:00
public:
2018-12-08 05:30:43 +00:00
enum class EMessageReturn { Normal = 0, Exit = 1, RemoveIOWinAndExit = 2, RemoveIOWin = 3 };
explicit CIOWin(std::string_view name) : x4_name(name) { m_nameHash = std::hash<std::string_view>()(name); }
virtual ~CIOWin() = default;
2018-12-08 05:30:43 +00:00
virtual EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) = 0;
virtual bool GetIsContinueDraw() const { return true; }
virtual void Draw() {}
virtual void PreDraw() {}
2018-12-08 05:30:43 +00:00
std::string_view GetName() const { return x4_name; }
size_t GetNameHash() const { return m_nameHash; }
2015-08-18 05:54:43 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde