3 #include <Engine/RaEngine.hpp>
4 #include <Engine/Scene/System.hpp>
36 template <
typename _BaseAbstractSystem>
40 using BaseAbstractSystem = _BaseAbstractSystem;
43 static_assert( std::is_base_of<Ra::Engine::Scene::System, BaseAbstractSystem>::value,
44 "BaseAbstractSystem must inherit Ra::Core::System" );
54 inline void addSystem( BaseAbstractSystem* s ) { m_systems.emplace_back( s ); }
58 dispatch( [taskQueue, &frameInfo](
const auto& s ) {
59 s->generateTasks( taskQueue, frameInfo );
62 inline void handleAssetLoading( Entity* entity,
const Core::Asset::FileData* data )
override {
63 BaseAbstractSystem::handleAssetLoading( entity, data );
64 dispatch( [entity, data](
const auto& s ) { s->handleAssetLoading( entity, data ); } );
70 template <
typename Functor>
72 for (
auto& s : m_systems )
78 template <
typename Functor>
80 for (
const auto& s : m_systems )
109 template <
typename Functor>
111 for (
auto& s : m_systems ) {
112 if ( !f( s ) && abortWhenInvalid )
return false;
118 template <
typename Functor>
120 for (
const auto& s : m_systems ) {
121 if ( !f( s ) && abortWhenInvalid )
return false;
128 std::vector<std::unique_ptr<BaseAbstractSystem>> m_systems;
bool conditionnaldispatch(Functor f, bool abortWhenInvalid=true) const
void addSystem(BaseAbstractSystem *s)
void dispatch(Functor f) const
bool conditionnaldispatch(Functor f, bool abortWhenInvalid=true)
Structure passed to each system before they fill the task queue.