bevyengine / bevyengine/bevy

Add `world` and `world_mut` methods to `WorldChildBuilder`

Open
#15,414 2 comments 0 reactions 0 assignees View on GitHub
C-Usability D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

Allow `World` access when you only have a `WorldChildBuilder`.

## What solution would you like?

Add `world` and `world_mut` methods to `WorldChildBuilder`, returning references to the inner `&mut World`. This doesn't have to be `unsafe` like `EntityWorldMut::world_mut`, because the latter is only unsafe due to the `EntityLocation` stored in `EntityWorldMut` that could become invalidated. There is no `EntityLocation` stored in `WorldChildBuilder`.

## What alternative(s) have you considered?

None.

Contributor guide

Open the contributing guide

Research direction

Locate the definition and construction path of WorldChildBuilder, then read the related EntityWorldMut world access methods for comparison. Done means WorldChildBuilder exposes world and world_mut methods returning references to its inner World without requiring unsafe access, with coverage added wherever this API's existing tests live.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.