Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::World Struct Reference

Context passed to every System::update call. More...

#include <World.hpp>

Public Member Functions

template<typename T>
T & require ()
 Convenience accessor for services.

Public Attributes

ecs::Registry & registry
 ECS entity/component storage.
ServiceRegistry & services
 All engine services.
f32 deltaTime
 Seconds since last frame.

Detailed Description

Context passed to every System::update call.

Provides access to the ECS registry, all registered services, and frame timing. Systems should use this instead of global state.

void update(World& world) override {
auto& registry = world.registry;
auto& input = world.services.require<Input>();
f32 dt = world.deltaTime;
}
float f32
32-bit floating point
Definition Types.hpp:59
Context passed to every System::update call.
Definition World.hpp:40
ecs::Registry & registry
ECS entity/component storage.
Definition World.hpp:41

Definition at line 40 of file World.hpp.

Member Function Documentation

◆ require()

template<typename T>
T & esengine::World::require ( )
inline

Convenience accessor for services.

Definition at line 47 of file World.hpp.

References services.

Member Data Documentation

◆ deltaTime

f32 esengine::World::deltaTime

Seconds since last frame.

Definition at line 43 of file World.hpp.

◆ registry

ecs::Registry& esengine::World::registry

ECS entity/component storage.

Definition at line 41 of file World.hpp.

◆ services

ServiceRegistry& esengine::World::services

All engine services.

Definition at line 42 of file World.hpp.

Referenced by require().


The documentation for this struct was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/core/World.hpp