Skip to content

implement component access for WorldCell#5632

Closed
jakobhellermann wants to merge 2 commits intobevyengine:mainfrom
jakobhellermann:world-cell-components
Closed

implement component access for WorldCell#5632
jakobhellermann wants to merge 2 commits intobevyengine:mainfrom
jakobhellermann:world-cell-components

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

Comments