12 return m_scenes.get(sceneIndex);
22 return m_scenes.size();
27 auto optIndex = m_scenes.indexOf(scene);
33 return static_cast<std::size_t
>(-1);
36template<
typename EventType>
39 constexpr bool hasPostTraits =
requires (EventType)
41 { EventType::canPost } -> std::same_as<bool>;
44 if constexpr(hasPostTraits)
46 static_assert(EventType::canPost,
47 "Attempting to post an event that does not allow event posting.");
59 [&eventDispatcher, e]()
61 dispatchPostedEventToListeners(e, eventDispatcher);
65template<
typename EventType>
66inline void Editor::dispatchPostedEventToListeners(
68 TEditorEventDispatcher<EventType>& eventDispatcher)
72 eventDispatcher.dispatch(
74 [](
const EventType& e,
const Listener& listener)
Definition DesignerScene.h:58
void add(EventUpdateWork work)
Definition EditorEventQueue.h:46
DesignerScene * getScene(std::size_t sceneIndex) const
Definition Editor.ipp:10
std::size_t getSceneIndex(const DesignerScene *scene) const
Get index of the scene. Most scene operations in the editor take scene index as input,...
Definition Editor.ipp:25
void postEvent(const EventType &e, TEditorEventDispatcher< EventType > &eventDispatcher)
Specify an event that is going to be dispatched by the dispatcher. The event will not be dispatched i...
Definition Editor.ipp:37
static constexpr std::size_t nullSceneIndex()
Definition Editor.ipp:31
DesignerScene * getActiveScene() const
Definition Editor.ipp:15
std::size_t numScenes() const
Definition Editor.ipp:20
Definition TClassEventDispatcher.h:13
DispatcherType::Listener Listener
Definition TClassEventDispatcher.h:20
Definition ph_editor.h:10