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

fix: Add necessary generics on mixins on FlameGame #2763

Merged
merged 5 commits into from
Sep 22, 2023
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
@@ -1,3 +1,4 @@
import 'package:flame/camera.dart';
import 'package:flame/collisions.dart';
import 'package:flame/extensions.dart';
import 'package:flame/game.dart';
Expand All @@ -15,7 +16,7 @@ import 'package:flame/game.dart';
///
/// [initializeCollisionDetection] should be called in the game's [onLoad]
/// method.
mixin HasQuadTreeCollisionDetection on FlameGame
mixin HasQuadTreeCollisionDetection<W extends World> on FlameGame<W>
implements HasCollisionDetection<QuadTreeBroadphase> {
late QuadTreeCollisionDetection _collisionDetection;

Expand Down
4 changes: 2 additions & 2 deletions packages/flame/lib/src/game/mixins/keyboard.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame/src/components/mixins/keyboard_handler.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Expand All @@ -9,7 +8,8 @@ import 'package:flutter/services.dart';
///
/// Attention: should not be used alongside [KeyboardEvents] in a game subclass.
/// Using this mixin remove the necessity of [KeyboardEvents].
mixin HasKeyboardHandlerComponents on FlameGame implements KeyboardEvents {
mixin HasKeyboardHandlerComponents<W extends World> on FlameGame<W>
implements KeyboardEvents {
@override
@mustCallSuper
KeyEventResult onKeyEvent(
Expand Down