This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Legion refactoring renames a lot of functions to be more in line with the standard library, should we do the same?
If we add fn foo(builder: &mut EntityBuilder) {
builder.add(...)
}
let mut builder = EntityBuilder::new()
.with(...);
foo(&mut builder);
builder.build().spawn_in(&mut world); |
caelunshun
reviewed
May 11, 2020
src/builder.rs
Outdated
pub fn build(self) -> BuiltEntity<'static> { | ||
BuiltEntity { | ||
builder: CowMut::Owned(self), | ||
written: false, | ||
} | ||
} | ||
|
||
/// This one seems redudent, since spawning clears the internal components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build_one
can be used to re-use the EntityBuilder
's allocations as an optimization.
src/events.rs
Outdated
@@ -82,7 +82,7 @@ impl EventHandlers { | |||
} | |||
} | |||
|
|||
/// Triggers an event. | |||
/// Emeits the given event `E` with given resources and world. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
caelunshun
approved these changes
May 11, 2020
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds documentation to all publicly exposed functions.
This PR also adds
fecs::World::batch_remove
, Legion does not exposelegion::World::add_components
to allow forfecs::World::batch_add
.A few notes reading through the source.
Executor::set_up
should only be run once or should we keep track of which systems have been set up correctly? This can be easily be done by tracking the length at each call toExecutor::set_up
since there's no way of removing systems.EntityBuilder::add
should not be exposed publicly sinceEntityBuilder::with
should be preferred?EntityBuilder::build_one
seems strange and useless since spawning the entity into a world resets the builder, it does however reuse the internal vectors?World::try_get
should be renamedWorld::get
andWorld::get
should be removed in favour ofOption::unwrap
?