R-Type  2
Doom but in better
Loading...
Searching...
No Matches
LifetimeSystem.cpp File Reference
#include "LifetimeSystem.hpp"
#include "IndexedZipper.hpp"
#include "Time.hpp"
Include dependency graph for LifetimeSystem.cpp:

Go to the source code of this file.

Functions

void lifetime_system (Registry &r, ComponentContainer< Lifetime > &lifetimes)
 Manages the lifetime of entities by decreasing their time left.
 

Function Documentation

◆ lifetime_system()

void lifetime_system ( Registry & r,
ComponentContainer< Lifetime > & lifetimes )

Manages the lifetime of entities by decreasing their time left.

This function handles the expiration of entities based on their lifetime. It updates the Lifetime component of each entity by decreasing the time_left value based on the time passed (delta_time). If an entity's lifetime expires (i.e., time_left reaches zero or below), it may be removed or marked for destruction.

Parameters
rThe Registry that contains all game entities and their components.
lifetimesThe container of the component Lifetime.

Definition at line 6 of file LifetimeSystem.cpp.