Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix!: Make all ComponentSet modifications internal #1877

Merged
merged 5 commits into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/flame/lib/src/components/core/component_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,32 @@ class ComponentSet extends QueryableOrderedSet<Component> {
@override
bool add(Component component) => super.add(component);

/// Marked as internal, because the users shouldn't be able to add elements
/// into the [ComponentSet] directly, bypassing the normal lifecycle handling.
@internal
@override
int addAll(Iterable<Component> components) => super.addAll(components);

/// Marked as internal, because the users shouldn't be able to remove elements
/// from the [ComponentSet] directly, bypassing the normal lifecycle handling.
@internal
@override
bool remove(Component component) => super.remove(component);

/// Marked as internal, because the users shouldn't be able to remove elements
/// from the [ComponentSet] directly, bypassing the normal lifecycle handling.
@internal
@override
Iterable<Component> removeAll(Iterable<Component> components) =>
super.removeAll(components);

/// Marked as internal, because the users shouldn't be able to remove elements
/// from the [ComponentSet] directly, bypassing the normal lifecycle handling.
@internal
@override
Iterable<Component> removeWhere(bool Function(Component element) test) =>
super.removeWhere(test);

/// Marked as internal, because the users shouldn't be able to remove elements
/// from the [ComponentSet] directly, bypassing the normal lifecycle handling.
@internal
Expand Down