Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::FunctionSystem Class Referencefinal

System made of a function, for logic that keeps no state of its own. More...

#include <aegis2d/ecs/system.hpp>

Inheritance diagram for aegis2d::ecs::FunctionSystem:
aegis2d::ecs::ISystem

Public Types

using Function = std::function< void(Registry &registry, const Tick &tick)>
 Signature of the function: the same as ISystem::update().
 

Public Member Functions

 FunctionSystem (Function function)
 Wraps a function.
 
void update (Registry &registry, 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.
 

Detailed Description

System made of a function, for logic that keeps no state of its own.

Member Typedef Documentation

◆ Function

using aegis2d::ecs::FunctionSystem::Function = std::function<void(Registry& registry, const Tick& tick)>

Signature of the function: the same as ISystem::update().

Constructor & Destructor Documentation

◆ FunctionSystem()

aegis2d::ecs::FunctionSystem::FunctionSystem ( Function  function)
explicit

Wraps a function.

Parameters
functionCalled by every update().
Exceptions
std::invalid_argumentIf function is empty.

Member Function Documentation

◆ update()

void aegis2d::ecs::FunctionSystem::update ( Registry &  registry,
const Tick &  tick 
)
overridevirtual

Calls the function.

Parameters
registryWorld given to the function.
tickStep given to the function.

Implements aegis2d::ecs::ISystem.


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