<commit_before>import 'dart:math' as math;

import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flutter/material.dart';
import 'package:geometry/geometry.dart' as geometry show centroid;
import 'package:pinball_components/gen/assets.gen.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_components/src/components/bumping_behavior.dart';
import 'package:pinball_components/src/components/kicker/behaviors/behaviors.dart';
import 'package:pinball_flame/pinball_flame.dart';

export 'cubit/kicker_cubit.dart';

/// {@template kicker}
/// Triangular [BodyType.static] body that propels the [Ball] towards the
/// opposite side.
///
/// [Kicker]s are usually positioned above each [Flipper].
/// {@endtemplate kicker}
class Kicker extends BodyComponent with InitialPosition {
  /// {@macro kicker}
  Kicker({
    required BoardSide side,
    Iterable<Component>? children,
  }) : this._(
          side: side,
          bloc: KickerCubit(),
          children: children,
        );

  Kicker._({
    required BoardSide side,
    required this.bloc,
    Iterable<Component>? children,
  })  : _side = side,
        super(
          children: [
            BumpingBehavior(strength: 20)..applyTo(['bouncy_edge']),
            KickerBallContactBehavior()..applyTo(['bouncy_edge']),
            KickerBlinkingBehavior(),
            _KickerSpriteGroupComponent(
              side: side,
              state: bloc.state,
            ),
            ...?children,
          ],
          renderBody: false,
        );

  /// Creates a [Kicker] without any children.
  ///
  /// This can be used for testing [Kicker]'s behaviors in isolation.
  // TODO(alestiago): Refactor injecting bloc once the following is merged:
  // https://github.com/flame-engine/flame/pull/1538
  @visibleForTesting
  Kicker.test({
    required this.bloc,
    required BoardSide side,
  }) : _side = side;
<commit_msg>fix: slightly increased Kicker's strength (#295)<commit_after>import 'dart:math' as math;

import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flutter/material.dart';
import 'package:geometry/geometry.dart' as geometry show centroid;
import 'package:pinball_components/gen/assets.gen.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_components/src/components/bumping_behavior.dart';
import 'package:pinball_components/src/components/kicker/behaviors/behaviors.dart';
import 'package:pinball_flame/pinball_flame.dart';

export 'cubit/kicker_cubit.dart';

/// {@template kicker}
/// Triangular [BodyType.static] body that propels the [Ball] towards the
/// opposite side.
///
/// [Kicker]s are usually positioned above each [Flipper].
/// {@endtemplate kicker}
class Kicker extends BodyComponent with InitialPosition {
  /// {@macro kicker}
  Kicker({
    required BoardSide side,
    Iterable<Component>? children,
  }) : this._(
          side: side,
          bloc: KickerCubit(),
          children: children,
        );

  Kicker._({
    required BoardSide side,
    required this.bloc,
    Iterable<Component>? children,
  })  : _side = side,
        super(
          children: [
            BumpingBehavior(strength: 25)..applyTo(['bouncy_edge']),
            KickerBallContactBehavior()..applyTo(['bouncy_edge']),
            KickerBlinkingBehavior(),
            _KickerSpriteGroupComponent(
              side: side,
              state: bloc.state,
            ),
            ...?children,
          ],
          renderBody: false,
        );

  /// Creates a [Kicker] without any children.
  ///
  /// This can be used for testing [Kicker]'s behaviors in isolation.
  // TODO(alestiago): Refactor injecting bloc once the following is merged:
  // https://github.com/flame-engine/flame/pull/1538
  @visibleForTesting
  Kicker.test({
    required this.bloc,
    required BoardSide side,
  }) : _side = side;

{'fraction_non_alphanumeric': 0.12372417226786159, 'fraction_numerical': 0.004729897933781429, 'mean_word_length': 3.075050709939148, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5628727', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1217, 'n_words': 269}