Problem Statement
For now, we are forced to define a scheduler in the template params of RegisterSystems of Engine::APlugin, but that's not very convenient as we are often using Update scheduler. And Engine::Core already implement this pattern which is particularly convenient, specifically when creating test and creating systems in games.
Proposed Solution
Add a default scheduler to RegisterSystems of plugins.
Use Cases
Describe how this feature would be used and who would benefit from it:
- Use case 1: Avoid specifying scheduler to add update logic
Impact
Describe the potential impact of this feature:
- Less code for the same purpose
Implementation Details
You could implement it like this:
|
template <typename... Systems> inline decltype(auto) Core::RegisterSystem(Systems... systems) |
|
{ |
|
if (!this->_schedulers.Contains(_defaultScheduler)) |
|
{ |
|
Log::Warning(fmt::format("Trying to register systems with a default scheduler that does not exist: {}", |
|
_defaultScheduler.name())); |
|
} |
|
return this->_schedulers.GetScheduler(_defaultScheduler)->AddSystems(systems...); |
|
} |
Related Issues
List any related issues or PRs:
Problem Statement
For now, we are forced to define a scheduler in the template params of
RegisterSystemsofEngine::APlugin, but that's not very convenient as we are often using Update scheduler. AndEngine::Corealready implement this pattern which is particularly convenient, specifically when creating test and creating systems in games.Proposed Solution
Add a default scheduler to
RegisterSystemsof plugins.Use Cases
Describe how this feature would be used and who would benefit from it:
Impact
Describe the potential impact of this feature:
Implementation Details
You could implement it like this:
EngineSquared/src/engine/src/core/Core.ipp
Lines 86 to 94 in e480ac2
Related Issues
List any related issues or PRs: