Class for the game engine. More...
#include <Engine.hpp>
Public Member Functions | |
Engine (const std::function< std::shared_ptr< IAudio >()> &audioFactory, const std::function< std::shared_ptr< INetworkClient >()> &networkFactory, const std::function< std::shared_ptr< IRenderer >()> &rendererFactory) | |
~Engine ()=default | |
Engine (const Engine &)=delete | |
Engine & | operator= (const Engine &)=delete |
Engine (Engine &&)=delete | |
Engine & | operator= (Engine &&)=delete |
std::shared_ptr< IAudio > & | getAudio () |
std::shared_ptr< INetworkClient > & | getNetwork () |
std::shared_ptr< IRenderer > & | getRenderer () |
std::unique_ptr< utl::Clock > & | getClock () |
std::unique_ptr< SceneManager > & | getSceneManager () |
State | getState () const |
void | addSystem (std::unique_ptr< ISystem > system) |
void | setState (const State newState) |
void | render (ecs::Registry ®istry, Color clearColor, float dt) const |
void | stop () const |
Private Member Functions | |
void | updateSystems (ecs::Registry ®istry, float dt) const |
Private Attributes | |
State | m_state = RUN |
std::unique_ptr< utl::Clock > | m_clock |
std::unique_ptr< SceneManager > | m_sceneManager |
std::vector< std::unique_ptr< ISystem > > | m_systems |
std::shared_ptr< IAudio > | m_audio |
std::shared_ptr< INetworkClient > | m_network |
std::shared_ptr< IRenderer > | m_renderer |
Class for the game engine.
Definition at line 35 of file Engine.hpp.
eng::Engine::Engine | ( | const std::function< std::shared_ptr< IAudio >()> & | audioFactory, |
const std::function< std::shared_ptr< INetworkClient >()> & | networkFactory, | ||
const std::function< std::shared_ptr< IRenderer >()> & | rendererFactory ) |
Definition at line 3 of file engine.cpp.
|
default |
|
delete |
|
delete |
|
inline |
Definition at line 56 of file Engine.hpp.
References m_systems.
Referenced by cli::Client::Client().
|
inline |
Definition at line 49 of file Engine.hpp.
References m_audio.
Referenced by cli::Client::Client().
|
inline |
Definition at line 52 of file Engine.hpp.
References m_clock.
|
inline |
Definition at line 50 of file Engine.hpp.
References m_network.
|
inline |
Definition at line 51 of file Engine.hpp.
References m_renderer.
Referenced by cli::Client::Client(), and cli::Client::handleEvents().
|
inline |
Definition at line 53 of file Engine.hpp.
References m_sceneManager.
Referenced by cli::Client::Client(), and cli::Client::handleEvents().
|
inline |
Definition at line 54 of file Engine.hpp.
References m_state.
void eng::Engine::render | ( | ecs::Registry & | registry, |
Color | clearColor, | ||
float | dt ) const |
Definition at line 19 of file engine.cpp.
|
inline |
Definition at line 57 of file Engine.hpp.
References m_state.
Referenced by cli::Client::handleEvents().
|
inline |
Definition at line 60 of file Engine.hpp.
References m_renderer.
|
private |
Definition at line 11 of file engine.cpp.
|
private |
Definition at line 69 of file Engine.hpp.
Referenced by getAudio().
|
private |
Definition at line 66 of file Engine.hpp.
Referenced by getClock().
|
private |
Definition at line 70 of file Engine.hpp.
Referenced by getNetwork().
|
private |
Definition at line 71 of file Engine.hpp.
Referenced by getRenderer(), and stop().
|
private |
Definition at line 67 of file Engine.hpp.
Referenced by getSceneManager().
Definition at line 65 of file Engine.hpp.
Referenced by getState(), and setState().
|
private |
Definition at line 68 of file Engine.hpp.
Referenced by addSystem().