|
Aegis2D
Modular C++26 2D game engine for networked games
|
System made of a function, for logic that keeps no state of its own. More...
#include <aegis2d/ecs/system.hpp>
Public Types | |
| using | Function = std::function< void(Registry ®istry, const Tick &tick)> |
| Signature of the function: the same as ISystem::update(). | |
Public Member Functions | |
| FunctionSystem (Function function) | |
| Wraps a function. | |
| void | update (Registry ®istry, const Tick &tick) override |
| Calls the function. | |
Public Member Functions inherited from aegis2d::ecs::ISystem | |
| ISystem ()=default | |
| ISystem (const ISystem &)=delete | |
| ISystem & | operator= (const ISystem &)=delete |
| ISystem (ISystem &&)=delete | |
| ISystem & | operator= (ISystem &&)=delete |
| virtual | ~ISystem () |
| Releases the system's own state. | |
System made of a function, for logic that keeps no state of its own.
| using aegis2d::ecs::FunctionSystem::Function = std::function<void(Registry& registry, const Tick& tick)> |
Signature of the function: the same as ISystem::update().
|
explicit |
Wraps a function.
| function | Called by every update(). |
| std::invalid_argument | If function is empty. |
|
overridevirtual |
Calls the function.
| registry | World given to the function. |
| tick | Step given to the function. |
Implements aegis2d::ecs::ISystem.