Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
timers.hpp File Reference

Timers: something happens every few seconds, or once after a delay, at any tick rate. More...

#include <aegis2d/ecs/entity.hpp>
#include <aegis2d/ecs/registry.hpp>
#include <aegis2d/ecs/system.hpp>
#include <algorithm>
#include <cstdint>
#include <vector>

Go to the source code of this file.

Classes

struct  aegis2d::ecs::Timer
 Fires every period seconds (a tower that shoots, a wave every 30 s), or once after a delay (a bomb, a message that goes away). More...
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::ecs
 Entity-Component-System used by client and server.
 

Functions

std::uint32_t aegis2d::ecs::advance (Timer &timer, float seconds) noexcept
 Moves a timer forward and tells how many times it fires.
 
void aegis2d::ecs::fire_timers (Registry &registry, const Tick &tick, std::vector< Entity > &fired)
 Advances every Timer by one tick and lists the entities whose timer fired.
 

Detailed Description

Timers: something happens every few seconds, or once after a delay, at any tick rate.