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

implement component access for WorldCell #5632

Closed

Conversation

jakobhellermann
Copy link
Contributor

Objective

  • WorldCell can hand out multiple mutable references to resources checked at runtime, but it would be nice if it also worked for components

Solution

  • duplicate ArchetypeComponentAccess into EntityComponentAccess
  • adapt WorldBorrow[Mut] to be able to handle accesses of both kinds (resource and component)

NOTE: this implementation may not be the most efficient, I'm just using a HashMap for the access. We could perhaps implement a more optimized approach inspired by Ralith/hecs#247, but that is something for another PR.

Changelog

  • add WorldCell::get_component and WorldCell::get_component_mut

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Aug 9, 2022
@ItsDoot
Copy link
Contributor

ItsDoot commented Jul 15, 2024

WorldCell was removed in #12551, visit the linked PR for the rationale.

@ItsDoot ItsDoot closed this Jul 15, 2024
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-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants