ddnet/src/game/editor/component.cpp
ChillerDragon 3c5320aa90 Rename editor component Init to OnInit
This matches the naming convention used for client components and the
`GameServer()->OnInit()`
2024-07-27 22:07:56 +08:00

25 lines
467 B
C++

#include "component.h"
bool CEditorComponent::OnInput(const IInput::CEvent &Event)
{
for(CEditorComponent &Component : m_vSubComponents)
{
if(Component.OnInput(Event))
return true;
}
return false;
}
void CEditorComponent::InitSubComponents()
{
for(CEditorComponent &Component : m_vSubComponents)
{
Component.OnInit(Editor());
}
}
void CEditorComponent::RegisterSubComponent(CEditorComponent &Component)
{
m_vSubComponents.emplace_back(Component);
}