Skip to content

system_for_each must be able to accept Entity as a component#13

Merged
JohanNorberg merged 1 commit intomainfrom
feature/entity-foreach
Nov 23, 2025
Merged

system_for_each must be able to accept Entity as a component#13
JohanNorberg merged 1 commit intomainfrom
feature/entity-foreach

Conversation

@JohanNorberg
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for accepting Entity as a component parameter in system_for_each macro-generated functions, enabling systems to access entity identifiers during iteration. This aligns the macro with the existing ECS query system where Entity is already treated as a special queryable component type.

Key changes:

  • Extended the system_for_each macro to recognize Entity as a valid component type
  • Added comprehensive integration tests demonstrating entity-based filtering and destruction patterns

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
zero_ecs_macros/src/system_for_each_impl.rs Adds "Entity" to the set of recognized component types for system parameter validation
zero_ecs_testbed/src/integration_tests/test_simple.rs Adds test demonstrating Entity parameter usage for selective entity destruction based on component values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread zero_ecs_macros/src/system_for_each_impl.rs
@JohanNorberg JohanNorberg merged commit 366ab27 into main Nov 23, 2025
7 checks passed
@JohanNorberg JohanNorberg deleted the feature/entity-foreach branch November 23, 2025 18:58
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