1#include "component.h"
2
3void CEditorComponent::OnInit(CEditor *pEditor)
4{
5 CEditorObject::OnInit(pEditor);
6 OnReset();
7}
8
9void CEditorComponent::OnReset()
10{
11}
12
13void CEditorComponent::OnMapLoad()
14{
15}
16
17bool CEditorComponent::OnInput(const IInput::CEvent &Event)
18{
19 for(CEditorComponent &Component : m_vSubComponents)
20 {
21 // Events with flag `FLAG_RELEASE` must always be forwarded to all components so keys being
22 // released can be handled in all components also after some components have been disabled.
23 if(Component.OnInput(Event) && (Event.m_Flags & ~IInput::FLAG_RELEASE) != 0)
24 {
25 return true;
26 }
27 }
28 return false;
29}
30
31void CEditorComponent::OnUpdate()
32{
33}
34
35void CEditorComponent::InitSubComponents()
36{
37 for(CEditorComponent &Component : m_vSubComponents)
38 {
39 Component.OnInit(pEditor: Editor());
40 }
41}
42
43void CEditorComponent::RegisterSubComponent(CEditorComponent &Component)
44{
45 m_vSubComponents.emplace_back(args&: Component);
46}
47