Skip to content

Commit

Permalink
fix: Both places should have strictMode = false (#1272)
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Dec 26, 2021
1 parent 6936e1d commit 72161ad
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/flame/lib/src/components/component_set.dart
Expand Up @@ -41,11 +41,16 @@ class ComponentSet extends QueryableOrderedSet<Component> {
/// It is also called when the component changes parent.
final Component parent;

static bool defaultStrictMode = false;

ComponentSet(
int Function(Component e1, Component e2)? comparator,
this.parent, {
bool strictMode = false,
}) : super(comparator: comparator, strictMode: strictMode);
bool? strictMode,
}) : super(
comparator: comparator,
strictMode: strictMode ?? defaultStrictMode,
);

/// Prepares and registers one component to be added on the next game tick.
///
Expand Down Expand Up @@ -245,12 +250,12 @@ class ComponentSet extends QueryableOrderedSet<Component> {
/// will be added.
static ComponentSet createDefault(
Component parent, {
bool strictMode = true,
bool? strictMode,
}) {
return ComponentSet(
Comparing.on<Component>((c) => c.priority),
parent,
strictMode: strictMode,
strictMode: strictMode ?? defaultStrictMode,
);
}
}

0 comments on commit 72161ad

Please sign in to comment.