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

Use callback style interface to replace smart pointer #7

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

jjyr
Copy link
Owner

@jjyr jjyr commented Sep 4, 2024

All entities are stored in World.

The smart pointer Guard<T> style makes lifetime unmanageable when access multiple entities simutaneously.
Use callback style to access world can force lifetime been kept in a small scope. gpui also use this style.

The method to access multiple Entities while using mut ref to avoid data race is inspired by Bevy World API

@jjyr jjyr force-pushed the refactor-world-ref branch from bace133 to 95542f6 Compare September 4, 2024 16:12
@jjyr jjyr changed the title Use callback style interface to access world; World return ent reference to replace Mut Use callback style interface to replace smart pointer Sep 4, 2024
@jjyr jjyr force-pushed the refactor-world-ref branch from 95542f6 to 6db8006 Compare September 4, 2024 16:14
@jjyr jjyr merged commit f4cfc0b into master Sep 4, 2024
10 checks passed
@jjyr jjyr deleted the refactor-world-ref branch September 4, 2024 16:16
@jjyr jjyr restored the refactor-world-ref branch January 1, 2025 04:59
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.

1 participant