Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

refactor: Fix unrelated types reported by DCM #3023

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ class QuadTree<T extends Hitbox<T>> {
}

void remove(T hitbox, {bool keepOldPosition = false}) {
final node = _hitboxAtNode.remove(hitbox);
final node = _hitboxAtNode.remove(hitbox as ShapeHitbox);
if (node != null) {
node.hitboxes.remove(hitbox);
if (!keepOldPosition) {
_oldPositionByItem.remove(hitbox);
_oldPositionByItem.remove(hitbox as ShapeHitbox);
}
}
}
Expand Down Expand Up @@ -273,7 +273,7 @@ class QuadTree<T extends Hitbox<T>> {
}

bool hasMoved(T hitbox) {
final lastPos = _oldPositionByItem[hitbox];
final lastPos = _oldPositionByItem[hitbox as ShapeHitbox];
if (lastPos == null) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/test/collisions/collision_test_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class TestBlock extends PositionComponent with CollisionCallbacks {
return activeCollisions.contains(other);
}

bool collidedWithExactly(List<CollisionCallbacks> collidables) {
bool collidedWithExactly(List<PositionComponent> collidables) {
final otherCollidables = collidables.toSet()..remove(this);
return activeCollisions.containsAll(otherCollidables) &&
otherCollidables.containsAll(activeCollisions);
Expand Down
Loading