R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
ecs::ISystem Class Referenceabstract

Base interface for all ECS systems. More...

#include <ISystem.hpp>

Inheritance diagram for ecs::ISystem:
Inheritance graph
Collaboration diagram for ecs::ISystem:
Collaboration graph

Public Member Functions

virtual ~ISystem ()=default
 Virtual destructor.
 
virtual void update (Registry &registry, float deltaTime)=0
 Update the system logic for one frame.
 
virtual ComponentMask getComponentMask () const =0
 Get the bitmask of required components.
 

Detailed Description

Base interface for all ECS systems.

All systems in the Entity-Component-System must inherit from this interface. Systems contain the game logic and operate on entities with specific component combinations.

Note
Systems should be stateless when possible.
Logic processes entities based on their component composition.
Each system defines which components it requires via getComponentMask().

Definition at line 37 of file ISystem.hpp.

Constructor & Destructor Documentation

◆ ~ISystem()

virtual ecs::ISystem::~ISystem ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ getComponentMask()

virtual ComponentMask ecs::ISystem::getComponentMask ( ) const
pure virtual

Get the bitmask of required components.

Returns a bitmask indicating which components an entity must have to be processed by this system. The Registry uses this mask to filter entities.

Returns
ComponentMask Bitmask of required component types

Implemented in ecs::AISystem, ecs::AnimationSystem, ecs::BoundarySystem, ecs::BuffSystem, ecs::CollisionSystem, ecs::HealthSystem, ecs::MapSystem, ecs::MovementSystem, ecs::OrbitalSystem, ecs::SpawnSystem, ecs::WeaponSystem, and scripting::LuaSystemAdapter.

◆ update()

virtual void ecs::ISystem::update ( Registry registry,
float  deltaTime 
)
pure virtual

Update the system logic for one frame.

Called every frame by the game loop. The system processes all entities that match its component requirements.

Parameters
registryReference to the ECS registry containing all entities
deltaTimeTime elapsed since last frame (in seconds)

Implemented in scripting::LuaSystemAdapter, ecs::AISystem, ecs::AnimationSystem, ecs::BoundarySystem, ecs::BuffSystem, ecs::CollisionSystem, ecs::HealthSystem, ecs::MapSystem, ecs::MovementSystem, ecs::OrbitalSystem, ecs::SpawnSystem, and ecs::WeaponSystem.


The documentation for this class was generated from the following file: