FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

example: enhance basic core usage by Miou-zora · Pull Request #461 · EngineSquared/EngineSquared · GitHub

example: enhance basic core usage - #461

Merged
ripel2 merged 2 commits into
mainfrom
enhance-basic-core-usage
Jan 31, 2026
Merged

example: enhance basic core usage#461
ripel2 merged 2 commits into
mainfrom
enhance-basic-core-usage

Conversation

Miou-zora commented Jan 31, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown
Contributor

This pull request introduces a new resource and several new systems to the example usage of the engine, expands the scheduler's functionality to allow dynamic removal of systems, and adds corresponding tests. The changes demonstrate a more realistic and flexible ECS (Entity-Component-System) workflow, including resource management, system scheduling, and dynamic system control.

Enhancements to engine example and ECS workflow:

  • Refactored main.cpp to introduce a DirectorResource and multiple new components (NameComponent, WorkTimeComponent) and systems (DirectorMonitorSystem, HelloSystem, WorkHoursUpdateSystem, CloseSystem, WorkingSystem, GoodbyeSystem). The example now simulates a day at a school with entities, resources, and systems interacting in a realistic workflow.
  • Demonstrated dynamic system control in main.cpp by enabling, disabling, and removing systems at runtime based on resource state, showcasing advanced scheduler usage.

Scheduler improvements:

  • Added a Remove method to the AScheduler class, allowing systems to be removed from the scheduler at runtime by their function ID. [1] [2]

Testing:

  • Added a new test RemoveSystem in SystemTest.cpp to verify that removing a system from the scheduler prevents it from running in subsequent cycles.

Summary by CodeRabbit

  • New Features

    • Added ability to remove and unregister systems at runtime from the scheduler, enabling dynamic system management.
  • Examples

    • Updated basic example showcasing advanced ECS patterns with multiple systems, components, and resource orchestration.
  • Tests

    • Added test coverage for system removal functionality to validate dynamic system lifecycle management.

✏️ Tip: You can customize this high-level summary in your review settings.

Miou-zora requested a review from a team January 31, 2026 15:50
Miou-zora self-assigned this Jan 31, 2026

coderabbitai Bot commented Jan 31, 2026
edited
Loading

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request introduces a system removal capability to the scheduler's public API, adding a Remove() method to delete registered systems at runtime. The changes are demonstrated through an expanded ECS-style example featuring resources, components, and multiple interacting systems, along with a test validating the removal functionality.

Changes

Cohort / File(s) Summary
Scheduler API Enhancement
src/engine/src/scheduler/AScheduler.hpp, src/engine/src/scheduler/AScheduler.cpp
Added public Remove(FunctionID) method to AScheduler that deletes a system from enabled or disabled lists and logs a warning if the ID is not found.
System Removal Test
src/engine/tests/engine/SystemTest.cpp
Added RemoveSystem test case validating that a registered system can be removed and no longer executes subsequent system runs.
ECS Architecture Example
examples/basic_core_usage/src/main.cpp
Replaced simple test component with full ECS example: added DirectorResource, NameComponent, WorkTimeComponent; implemented six systems (DirectorMonitor, Hello, WorkHoursUpdate, Close, Working, Goodbye); demonstrated dynamic system removal via lambda that disables DirectorMonitorSystem based on runtime state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A Director arrives with hours to track,
Systems bloom and dance, then fall back,
When the workday's done, away they go—
Remove and reset for the next grand show! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2 ❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'example: enhance basic core usage' is vague and partially related to the changeset. While it mentions the example file, it does not clearly convey the main improvements (ECS architecture, resources, systems, and scheduler API expansion). Consider a more specific title that highlights the key changes, such as 'example: demonstrate ECS systems and dynamic scheduler control' or 'example: enhance basic core usage with resources and systems'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enhance-basic-core-usage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

ripel2 commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

(the other examples fail but its not related to this PR)

ripel2 merged commit e3ed87c into main Jan 31, 2026
15 of 18 checks passed
ripel2 deleted the enhance-basic-core-usage branch January 31, 2026 19:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL