ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::ISystem Class Referenceabstract

System interface, base class of all systems. More...

#include <ISystem.hpp>

Inheritance diagram for ecstasy::ISystem:
Collaboration diagram for ecstasy::ISystem:

Public Member Functions

virtual ~ISystem ()=default
 Default destructor.
 
virtual void run (Registry &registry)=0
 Run the system.
 
constexpr TimergetTimer () noexcept
 Get the system timer.
 
constexpr const TimergetTimer () const noexcept
 Get the system timer.
 
constexpr bool enabled () const noexcept
 Whether the system is enabled.
 
constexpr void disable () noexcept
 Disable the system.
 
constexpr void enable () noexcept
 Enable the system.
 

Private Attributes

Timer _timer
 Timer to control the execution of the system.
 
bool _disabled = false
 Whether the timer is disabled.
 

Detailed Description

System interface, base class of all systems.

Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-17)

Definition at line 28 of file ISystem.hpp.

Constructor & Destructor Documentation

◆ ~ISystem()

virtual ecstasy::ISystem::~ISystem ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ disable()

constexpr void ecstasy::ISystem::disable ( )
inlineconstexprnoexcept

Disable the system.

Author
Andréas Leroux
Since
1.0.0 (2025-05-02)

Definition at line 92 of file ISystem.hpp.

93 {
94 _disabled = true;
95 }
bool _disabled
Whether the timer is disabled.
Definition ISystem.hpp:112

◆ enable()

constexpr void ecstasy::ISystem::enable ( )
inlineconstexprnoexcept

Enable the system.

Author
Andréas Leroux
Since
1.0.0 (2025-05-02)

Definition at line 103 of file ISystem.hpp.

104 {
105 _disabled = false;
106 }

◆ enabled()

constexpr bool ecstasy::ISystem::enabled ( ) const
inlineconstexprnoexcept

Whether the system is enabled.

Author
Andréas Leroux
Since
1.0.0 (2025-05-02)

Definition at line 81 of file ISystem.hpp.

82 {
83 return !_disabled;
84 }

◆ getTimer() [1/2]

constexpr const Timer & ecstasy::ISystem::getTimer ( ) const
inlineconstexprnoexcept

Get the system timer.

Note
The timer is used to control the execution of the system. You can also use Phase scale timers.
Returns
const Timer& Reference to the system timer.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-11-22)

Definition at line 70 of file ISystem.hpp.

71 {
72 return _timer;
73 }
Timer _timer
Timer to control the execution of the system.
Definition ISystem.hpp:110

◆ getTimer() [2/2]

constexpr Timer & ecstasy::ISystem::getTimer ( )
inlineconstexprnoexcept

Get the system timer.

Note
The timer is used to control the execution of the system. You can also use Phase scale timers.
Returns
Timer& Reference to the system timer.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-11-22)

Definition at line 54 of file ISystem.hpp.

55 {
56 return _timer;
57 }

◆ run()

virtual void ecstasy::ISystem::run ( Registry registry)
pure virtual

Run the system.

Parameters
[in]registryReference to the registry running the system.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-10-17)

Implemented in ecstasy::integration::sfml::PollEvents, and ecstasy::integration::user_action::PollActions< std::integer_sequence< Action::Id, Actions... > >.

Member Data Documentation

◆ _disabled

bool ecstasy::ISystem::_disabled = false
private

Whether the timer is disabled.

Definition at line 112 of file ISystem.hpp.

◆ _timer

Timer ecstasy::ISystem::_timer
private

Timer to control the execution of the system.

Definition at line 110 of file ISystem.hpp.


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