Suppose I have the following Mouse Event class with a Button event and extending Button Press and Button Release events:
namespace Event {
namespace Mouse {
class Button : public Event {
public:
inline Input::Code::Mouse get_mouse_button() const {
return m_Button;
}
EVENT_CLASS_CATEGORY(Event_Category_Input | Event_Category_Mouse)
protected:
Button(Input::Code::Mouse button)
: m_Button(button) {}
Input::Code::Mouse m_Button;
};
class Press : public Button {
public:
Press(Input::Code::Mouse button) : Button(button) {}
std::string to_string() const override {
return fmt::format("Mouse Button Press: {0}", m_Button);
}
EVENT_CLASS_TYPE(Mouse_Button_Press)
};
class Release : public Button {
public:
Release(Input::Code::Mouse button)
: Button(button) {}
std::string to_string() const override {
return fmt::format("Mouse Button Release: ", m_Button);
}
EVENT_CLASS_TYPE(Mouse_Button_Release)
};
}
}
I would like to refer to these with Event::Mouse::Button::Press and Event::Mouse::Button::Release instead of Event::Mouse::Press and Event::Mouse::Release. I cannot directly add the namespace Button to force this behavior because it would conflict with the Button class which is already defined. Is there a way to accomplish this? I understand I could name it Button_Press and Button_Release respectively, but I'd prefer not to for stylistic reasons. Thanks in advance! If it's not possible, I'll just suck it up and use the underscores.