Skip to content

Commit

Permalink
Merge #211
Browse files Browse the repository at this point in the history
211: Added DispatcherBuilder::contains r=torkleyy a=schell

Adds a `contains` method to `DispatcherBuilder` that allows the caller to determine if a system with the given name has already been added.

This supports amethyst/specs#736. 

Co-authored-by: Schell Carl Scivally <[email protected]>
  • Loading branch information
bors[bot] and schell authored Oct 18, 2021
2 parents 8c0ecbd + 7f6141f commit 3a88b7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dispatch/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ impl<'a, 'b> DispatcherBuilder<'a, 'b> {
self.stages_builder.insert(dependencies, id, system);
}

/// Returns `true` if a system with the given name has been added to the `BispatcherBuilder`,
/// otherwise, returns false.
pub fn contains(&self, name: &str) -> bool {
self.map.contains_key(name)
}

/// The `Batch` is a `System` which contains a `Dispatcher`.
/// By wrapping a `Dispatcher` inside a system, we can control the execution
/// of a whole group of system, without sacrificing parallelism or
Expand Down

0 comments on commit 3a88b7f

Please sign in to comment.