Nui Engine
A game engine framework
Loading...
Searching...
No Matches
System.h
1#pragma once
2#include "Core/Engine/ECS/Common.h"
3
4namespace Nui::ECS
5{
10 {
11 public:
15 virtual ~SystemBase() = default;
16
22 virtual void OnInit(Context* ctx) {}
23
29 virtual void OnUpdate(Context* ctx, const F64 dt) {}
30
36 virtual void OnShutdown(Context* ctx) {}
37
42 bool IsEnabled() const noexcept { return m_enabled; }
43
48 void SetIsEnabled(bool enabled) noexcept { m_enabled = enabled; }
49
50 private:
54 bool m_enabled{ true };
55 };
56}
The ECS context class manages entities, systems, and events in the ECS framework.
Definition Context.h:17
Base class for all ECS systems.
Definition System.h:10
bool IsEnabled() const noexcept
Check if the system is enabled.
Definition System.h:42
virtual void OnUpdate(Context *ctx, const F64 dt)
Called when the system is updated (every frame)
Definition System.h:29
virtual void OnInit(Context *ctx)
Called when the system is initialized.
Definition System.h:22
virtual ~SystemBase()=default
Default virtual destructor.
void SetIsEnabled(bool enabled) noexcept
Set if the system is enabled.
Definition System.h:48
virtual void OnShutdown(Context *ctx)
Called when the system is shutdown.
Definition System.h:36