Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using FilteredResources with ReflectResource. #15624

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chescock
Copy link
Contributor

@chescock chescock commented Oct 3, 2024

Objective

Support accessing resources using reflection when using FilteredResources in a dynamic system. This is similar to how components can be queried using reflection when using FilteredEntityRef|Mut.

Solution

Change ReflectResource from taking &World and &mut World to taking impl Into<FilteredResources> and impl Into<FilteredResourcesMut>, similar to how ReflectComponent takes impl Into<FilteredEntityRef> and impl Into<FilteredEntityMut>. There are From impls that ensure code passing &World and &mut World continues to work as before.

Migration Guide

If you are manually creating a ReflectComponentFns struct, the reflect function now takes FilteredResources instead &World, and there is a new reflect_mut function that takes FilteredResourcesMut.

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events S-Blocked This cannot move forward until something else changes labels Oct 3, 2024
@chescock chescock added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Blocked This cannot move forward until something else changes labels Oct 3, 2024
@chescock chescock marked this pull request as ready for review October 3, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants