refactor: renamed ContactCallback

pull/212/head
alestiago 3 years ago
parent d6f4a2e719
commit 83bf70458f

@ -20,7 +20,7 @@ class ControlledSparkyComputer extends SparkyComputer
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
gameRef.addContactCallback(SparkyTurboChargeSensorBallContactCallback()); gameRef.addContactCallback(SparkyComputerSensorBallContactCallback());
} }
} }
@ -40,17 +40,13 @@ class SparkyComputerController
/// Turbo charges the [Ball] when it enters the [SparkyComputer] /// Turbo charges the [Ball] when it enters the [SparkyComputer]
/// {@endtemplate} /// {@endtemplate}
@visibleForTesting @visibleForTesting
class SparkyTurboChargeSensorBallContactCallback class SparkyComputerSensorBallContactCallback
extends ContactCallback<SparkyComputerSensor, ControlledBall> { extends ContactCallback<SparkyComputerSensor, ControlledBall> {
/// {@macro sparky_turbo_charge_sensor_ball_contact_callback} /// {@macro sparky_turbo_charge_sensor_ball_contact_callback}
SparkyTurboChargeSensorBallContactCallback(); SparkyComputerSensorBallContactCallback();
@override @override
void begin( void begin(_, ControlledBall ball, __) {
SparkyComputerSensor sparkyTurboChargeSensor,
ControlledBall ball,
_,
) {
ball.controller.turboCharge(); ball.controller.turboCharge();
} }
} }

Loading…
Cancel
Save