This commit is contained in:
Isuru Samarathunga
2025-10-30 23:40:39 +05:30
parent 4e41048352
commit 7530303389
3 changed files with 27 additions and 5 deletions

View File

@ -34,7 +34,7 @@ namespace ia::iae
for(auto& t: m_components)
t->Draw();
for(auto& t: m_children)
t->Draw();
if B_LIKELY(t->IsEnabled()) t->Draw();
}
VOID Node2D::DebugDraw()
@ -42,7 +42,7 @@ namespace ia::iae
for(auto& t: m_components)
t->DebugDraw();
for(auto& t: m_children)
t->DebugDraw();
if B_LIKELY(t->IsEnabled()) t->DebugDraw();
}
VOID Node2D::Update()
@ -50,7 +50,7 @@ namespace ia::iae
for(auto& t: m_components)
t->Update();
for(auto& t: m_children)
t->Update();
if B_LIKELY(t->IsEnabled()) t->Update();
}
VOID Node2D::FixedUpdate()
@ -58,6 +58,6 @@ namespace ia::iae
for(auto& t: m_components)
t->FixedUpdate();
for(auto& t: m_children)
t->FixedUpdate();
if B_LIKELY(t->IsEnabled()) t->FixedUpdate();
}
} // namespace ia::iae

View File

@ -24,7 +24,7 @@ namespace ia::iae
class IComponent
{
public:
public:
PURE_VIRTUAL(VOID Draw());
PURE_VIRTUAL(VOID DebugDraw());
PURE_VIRTUAL(VOID Update());
@ -45,7 +45,18 @@ namespace ia::iae
return m_node;
}
BOOL &IsEnabled()
{
return m_isEnabled;
}
BOOL IsEnabled() CONST
{
return m_isEnabled;
}
protected:
Node2D *CONST m_node{};
BOOL m_isEnabled{true};
};
} // namespace ia::iae

View File

@ -38,7 +38,18 @@ namespace ia::iae
return m_name;
}
BOOL &IsEnabled()
{
return m_isEnabled;
}
BOOL IsEnabled() CONST
{
return m_isEnabled;
}
protected:
CONST String m_name;
BOOL m_isEnabled{true};
};
} // namespace ia::iae