GameDevTecnico / cubos

A still very barebones game engine focused on voxels and data-oriented programming
https://cubosengine.org
MIT License
83 stars 36 forks source link

Split Dispatcher into Planner and Schedule #1117

Closed RiscadoA closed 6 months ago

RiscadoA commented 6 months ago

Description

Replaces the current dispatcher by two new classes: Planner and Schedule.

A Schedule contains a list of systems, conditions and repeats to be run. They are run as their dependencies are fulfilled. This allows us to later on add multi-threading easily.

The Planner adds the logic of tags, and is responsible for maintaining the list of specified constraints, and building new schedules as needed. Since the logic is now separated, it will now be easy to implement plugin removal, as we just need to remove the constraints in the planner and generate a new schedule.

Checklist

github-actions[bot] commented 6 months ago

PR Preview Action v1.4.7 :---: :rocket: Deployed preview to https://GameDevTecnico.github.io/cubos/docs-preview/pr-1117/ on branch gh-pages at 2024-04-12 10:24 UTC

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 93.63636% with 56 lines in your changes are missing coverage. Please review.

Project coverage is 39.10%. Comparing base (3235ca0) to head (14e312f).

Files Patch % Lines
core/src/ecs/system/schedule.cpp 91.89% 15 Missing :warning:
core/src/ecs/system/planner.cpp 91.61% 13 Missing :warning:
core/src/ecs/cubos.cpp 79.24% 11 Missing :warning:
core/tests/ecs/system/utils.hpp 70.83% 7 Missing :warning:
core/src/ecs/system/registry.cpp 79.31% 6 Missing :warning:
core/include/cubos/core/ecs/cubos.hpp 0.00% 2 Missing :warning:
engine/src/physics/solver.cpp 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1117 +/- ## ========================================== + Coverage 38.31% 39.10% +0.78% ========================================== Files 323 330 +7 Lines 25713 26119 +406 ========================================== + Hits 9852 10213 +361 - Misses 15861 15906 +45 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.