metaforce/Runtime/CIOWin.hpp

32 lines
829 B
C++
Raw Permalink Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2015-08-17 22:54:43 -07:00
#include <functional>
#include <memory>
#include <string>
2015-08-19 19:52:07 -07:00
#include "Runtime/RetroTypes.hpp"
2016-08-05 16:48:53 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2015-08-21 18:58:41 -07:00
class CArchitectureMessage;
class CArchitectureQueue;
2015-08-17 22:54:43 -07:00
2018-12-07 21:30:43 -08:00
class CIOWin {
std::string x4_name;
size_t m_nameHash;
2015-08-19 19:52:07 -07:00
public:
2018-12-07 21:30:43 -08: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-07 21:30:43 -08:00
virtual EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) = 0;
virtual bool GetIsContinueDraw() const { return true; }
virtual void Draw() {}
virtual void PreDraw() {}
2018-12-07 21:30:43 -08:00
std::string_view GetName() const { return x4_name; }
size_t GetNameHash() const { return m_nameHash; }
2015-08-17 22:54:43 -07:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce