r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
eng::Engine Class Reference

Class for the game engine. More...

#include <Engine.hpp>

+ Collaboration diagram for eng::Engine:

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
 
Engineoperator= (const Engine &)=delete
 
 Engine (Engine &&)=delete
 
Engineoperator= (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 &registry, Color clearColor, float dt) const
 
void stop () const
 

Private Member Functions

void updateSystems (ecs::Registry &registry, float dt) const
 

Private Attributes

State m_state = RUN
 
std::unique_ptr< utl::Clockm_clock
 
std::unique_ptr< SceneManagerm_sceneManager
 
std::vector< std::unique_ptr< ISystem > > m_systems
 
std::shared_ptr< IAudiom_audio
 
std::shared_ptr< INetworkClientm_network
 
std::shared_ptr< IRendererm_renderer
 

Detailed Description

Class for the game engine.

Definition at line 35 of file Engine.hpp.

Constructor & Destructor Documentation

◆ Engine() [1/3]

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.

◆ ~Engine()

eng::Engine::~Engine ( )
default

◆ Engine() [2/3]

eng::Engine::Engine ( const Engine & )
delete

◆ Engine() [3/3]

eng::Engine::Engine ( Engine && )
delete

Member Function Documentation

◆ addSystem()

void eng::Engine::addSystem ( std::unique_ptr< ISystem > system)
inline

Definition at line 56 of file Engine.hpp.

References m_systems.

Referenced by cli::Client::Client().

+ Here is the caller graph for this function:

◆ getAudio()

std::shared_ptr< IAudio > & eng::Engine::getAudio ( )
inline

Definition at line 49 of file Engine.hpp.

References m_audio.

Referenced by cli::Client::Client().

+ Here is the caller graph for this function:

◆ getClock()

std::unique_ptr< utl::Clock > & eng::Engine::getClock ( )
inline

Definition at line 52 of file Engine.hpp.

References m_clock.

◆ getNetwork()

std::shared_ptr< INetworkClient > & eng::Engine::getNetwork ( )
inline

Definition at line 50 of file Engine.hpp.

References m_network.

◆ getRenderer()

std::shared_ptr< IRenderer > & eng::Engine::getRenderer ( )
inline

Definition at line 51 of file Engine.hpp.

References m_renderer.

Referenced by cli::Client::Client(), and cli::Client::handleEvents().

+ Here is the caller graph for this function:

◆ getSceneManager()

std::unique_ptr< SceneManager > & eng::Engine::getSceneManager ( )
inline

Definition at line 53 of file Engine.hpp.

References m_sceneManager.

Referenced by cli::Client::Client(), and cli::Client::handleEvents().

+ Here is the caller graph for this function:

◆ getState()

State eng::Engine::getState ( ) const
inline

Definition at line 54 of file Engine.hpp.

References m_state.

◆ operator=() [1/2]

Engine & eng::Engine::operator= ( const Engine & )
delete

◆ operator=() [2/2]

Engine & eng::Engine::operator= ( Engine && )
delete

◆ render()

void eng::Engine::render ( ecs::Registry & registry,
Color clearColor,
float dt ) const

Definition at line 19 of file engine.cpp.

◆ setState()

void eng::Engine::setState ( const State newState)
inline

Definition at line 57 of file Engine.hpp.

References m_state.

Referenced by cli::Client::handleEvents().

+ Here is the caller graph for this function:

◆ stop()

void eng::Engine::stop ( ) const
inline

Definition at line 60 of file Engine.hpp.

References m_renderer.

◆ updateSystems()

void eng::Engine::updateSystems ( ecs::Registry & registry,
float dt ) const
private

Definition at line 11 of file engine.cpp.

Member Data Documentation

◆ m_audio

std::shared_ptr<IAudio> eng::Engine::m_audio
private

Definition at line 69 of file Engine.hpp.

Referenced by getAudio().

◆ m_clock

std::unique_ptr<utl::Clock> eng::Engine::m_clock
private

Definition at line 66 of file Engine.hpp.

Referenced by getClock().

◆ m_network

std::shared_ptr<INetworkClient> eng::Engine::m_network
private

Definition at line 70 of file Engine.hpp.

Referenced by getNetwork().

◆ m_renderer

std::shared_ptr<IRenderer> eng::Engine::m_renderer
private

Definition at line 71 of file Engine.hpp.

Referenced by getRenderer(), and stop().

◆ m_sceneManager

std::unique_ptr<SceneManager> eng::Engine::m_sceneManager
private

Definition at line 67 of file Engine.hpp.

Referenced by getSceneManager().

◆ m_state

State eng::Engine::m_state = RUN
private

Definition at line 65 of file Engine.hpp.

Referenced by getState(), and setState().

◆ m_systems

std::vector<std::unique_ptr<ISystem> > eng::Engine::m_systems
private

Definition at line 68 of file Engine.hpp.

Referenced by addSystem().


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