Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
example.cpp
Go to the documentation of this file.
2
5
6namespace helios::example {
7
9 auto& resource = ctx.WriteResource<ExampleResource>();
10 ++resource.counter;
11}
12
17
19 /* No cleanup needed for this simple example */
20}
21
22} // namespace helios::example
Application class.
Definition app.hpp:97
auto InsertResource(this auto &&self, T &&resource) -> decltype(std::forward< decltype(self)>(self))
Inserts a resource into the main sub-app.
Definition app.hpp:719
auto AddSystem(this auto &&self, Schedule schedule={}) -> decltype(std::forward< decltype(self)>(self))
Adds a system to the specified schedule in the main sub-app.
Definition app.hpp:691
Per-system execution context with validated access.
T & WriteResource()
Gets mutable reference to a resource.
constexpr Update kUpdate
void Build(app::App &app) override
Builds the module, adding resources and systems to the app.
Definition example.cpp:13
void Destroy(app::App &app) override
Destroys the module, performing cleanup.
Definition example.cpp:18
Example resource to demonstrate module resources.
Definition example.hpp:22
Example system that increments the counter in ExampleResource.
Definition example.hpp:37
void Update(app::SystemContext &ctx) override
Updates the system, incrementing the example resource counter.
Definition example.cpp:8