-
Where is the real implementation for commands.entity(id)? I can only find that it resolves in an EntityCommand that then adds the commands to the top command when i am understanding it right, but where is the actual logic for that? Im kinda new to rust and dont really understand this kind of project organization :D thanks :D |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is the full implementation of bevy/crates/bevy_ecs/src/system/commands/mod.rs Lines 249 to 254 in 7d9e864 get_entity which is defined at bevy/crates/bevy_ecs/src/system/commands/mod.rs Lines 283 to 285 in 7d9e864 EntityCommands has a bunch of methods which add a command to the commands on which .entity(id) was originally called and use the passed in entity. For example commands.entity(id).insert(my_component) is implemented at bevy/crates/bevy_ecs/src/system/commands/mod.rs Lines 567 to 571 in 7d9e864 Insert { entity: self.entity, component } to the commands queue. The actual implementation of Insert that inserts the component can be found at bevy/crates/bevy_ecs/src/system/commands/mod.rs Lines 792 to 803 in 7d9e864 |
Beta Was this translation helpful? Give feedback.
This is the full implementation of
commands.entity(id)
:bevy/crates/bevy_ecs/src/system/commands/mod.rs
Lines 249 to 254 in 7d9e864
get_entity
which is defined atbevy/crates/bevy_ecs/src/system/commands/mod.rs
Lines 283 to 285 in 7d9e864
EntityCommands
has a bunch of methods which add a command to thecommands
on which.entity(id)
was originally called and use the passed in entity. For exa…