From 394acd1802a8fa78f12b48a7db8b8fb3e42daccd Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Thu, 24 Mar 2022 11:28:43 +0000 Subject: [PATCH 1/5] refactor: included ScorePoint generics (#88) --- lib/game/components/score_points.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/game/components/score_points.dart b/lib/game/components/score_points.dart index da894652..97cea82a 100644 --- a/lib/game/components/score_points.dart +++ b/lib/game/components/score_points.dart @@ -6,7 +6,7 @@ import 'package:pinball/game/game.dart'; /// {@template score_points} /// Specifies the amount of points received on [Ball] collision. /// {@endtemplate} -mixin ScorePoints on BodyComponent { +mixin ScorePoints on BodyComponent { /// {@macro score_points} int get points; From c8782cfbf4bcd7c050dd18b8d18501e5a2191130 Mon Sep 17 00:00:00 2001 From: Erick Date: Thu, 24 Mar 2022 09:17:41 -0300 Subject: [PATCH 2/5] refactor: splitting `Ball` business from UI logic (#86) * feat: refactoring ball component to separate business from ui logic * fix: tests * fix: lint * fix: test coverage * Update lib/game/components/ball.dart Co-authored-by: Alejandro Santiago Co-authored-by: Alejandro Santiago --- .github/workflows/pinball_components.yaml | 2 +- lib/flame/blueprint.dart | 16 +- lib/game/components/ball.dart | 81 +++------ lib/game/components/baseboard.dart | 1 + lib/game/components/board.dart | 1 + lib/game/components/bonus_word.dart | 1 + lib/game/components/components.dart | 2 - lib/game/components/flipper.dart | 1 + lib/game/components/jetpack_ramp.dart | 1 + lib/game/components/joint_anchor.dart | 2 +- lib/game/components/kicker.dart | 1 + lib/game/components/launcher_ramp.dart | 1 + lib/game/components/pathway.dart | 2 +- lib/game/components/plunger.dart | 1 + lib/game/components/ramp_opening.dart | 1 + lib/game/components/round_bumper.dart | 1 + lib/game/components/score_points.dart | 5 +- lib/game/components/spaceship.dart | 3 +- lib/game/components/wall.dart | 3 +- lib/game/game_assets.dart | 3 +- lib/game/pinball_game.dart | 10 +- lib/gen/assets.gen.dart | 2 - .../pinball_components/analysis_options.yaml | 5 +- .../assets/images}/ball.png | Bin .../lib/gen/assets.gen.dart | 68 ++++++++ .../lib/pinball_components.dart | 1 + .../lib/src/components/ball.dart | 72 ++++++++ .../lib/src/components/components.dart | 3 + .../lib/src}/components/initial_position.dart | 0 .../lib/src}/components/layer.dart | 0 .../lib/src/pinball_components.dart | 8 +- packages/pinball_components/pubspec.yaml | 16 +- .../test/helpers/helpers.dart | 1 + .../test/helpers/test_game.dart | 7 + .../test/src/components/ball_test.dart | 162 ++++++++++++++++++ .../components/initial_position_test.dart | 2 +- .../test/src}/components/layer_test.dart | 2 +- .../test/src/pinball_components_test.dart | 11 -- pubspec.lock | 7 + pubspec.yaml | 2 + test/flame/blueprint_test.dart | 16 +- test/game/components/ball_test.dart | 156 +---------------- test/game/components/flipper_test.dart | 4 +- test/game/components/ramp_opening_test.dart | 1 + test/game/components/score_points_test.dart | 13 +- test/game/components/spaceship_test.dart | 1 + test/game/components/wall_test.dart | 9 +- test/game/pinball_game_test.dart | 1 + test/helpers/mocks.dart | 6 + 49 files changed, 441 insertions(+), 274 deletions(-) rename {assets/images/components => packages/pinball_components/assets/images}/ball.png (100%) create mode 100644 packages/pinball_components/lib/gen/assets.gen.dart create mode 100644 packages/pinball_components/lib/src/components/ball.dart create mode 100644 packages/pinball_components/lib/src/components/components.dart rename {lib/game => packages/pinball_components/lib/src}/components/initial_position.dart (100%) rename {lib/game => packages/pinball_components/lib/src}/components/layer.dart (100%) create mode 100644 packages/pinball_components/test/helpers/helpers.dart create mode 100644 packages/pinball_components/test/helpers/test_game.dart create mode 100644 packages/pinball_components/test/src/components/ball_test.dart rename {test/game => packages/pinball_components/test/src}/components/initial_position_test.dart (97%) rename {test/game => packages/pinball_components/test/src}/components/layer_test.dart (98%) delete mode 100644 packages/pinball_components/test/src/pinball_components_test.dart diff --git a/.github/workflows/pinball_components.yaml b/.github/workflows/pinball_components.yaml index cab60a54..bf1907f8 100644 --- a/.github/workflows/pinball_components.yaml +++ b/.github/workflows/pinball_components.yaml @@ -16,4 +16,4 @@ jobs: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: working_directory: packages/pinball_components - coverage_excludes: "lib/src/generated/*.dart" + coverage_excludes: "lib/gen/*.dart" diff --git a/lib/flame/blueprint.dart b/lib/flame/blueprint.dart index 9f2a68f6..d536d650 100644 --- a/lib/flame/blueprint.dart +++ b/lib/flame/blueprint.dart @@ -12,19 +12,19 @@ const _attachedErrorMessage = "Can't add to attached Blueprints"; /// A [Blueprint] is a virtual way of grouping [Component]s /// that are related, but they need to be added directly on /// the [FlameGame] level. -abstract class Blueprint { +abstract class Blueprint { final List _components = []; bool _isAttached = false; /// Called before the the [Component]s managed /// by this blueprint is added to the [FlameGame] - void build(); + void build(T gameRef); /// Attach the [Component]s built on [build] to the [game] /// instance @mustCallSuper - Future attach(FlameGame game) async { - build(); + Future attach(T game) async { + build(game); await game.addAll(_components); _isAttached = true; } @@ -47,7 +47,7 @@ abstract class Blueprint { /// A [Blueprint] that provides additional /// structures specific to flame_forge2d -abstract class Forge2DBlueprint extends Blueprint { +abstract class Forge2DBlueprint extends Blueprint { final List _callbacks = []; /// Adds a single [ContactCallback] to this blueprint @@ -63,13 +63,11 @@ abstract class Forge2DBlueprint extends Blueprint { } @override - Future attach(FlameGame game) async { + Future attach(Forge2DGame game) async { await super.attach(game); - assert(game is Forge2DGame, 'Forge2DBlueprint used outside a Forge2DGame'); - for (final callback in _callbacks) { - (game as Forge2DGame).addContactCallback(callback); + game.addContactCallback(callback); } } diff --git a/lib/game/components/ball.dart b/lib/game/components/ball.dart index def21929..756a8a97 100644 --- a/lib/game/components/ball.dart +++ b/lib/game/components/ball.dart @@ -1,61 +1,40 @@ import 'package:flame/components.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; +import 'package:pinball/flame/blueprint.dart'; import 'package:pinball/game/game.dart'; -import 'package:pinball/gen/assets.gen.dart'; +import 'package:pinball_components/pinball_components.dart'; -/// {@template ball} -/// A solid, [BodyType.dynamic] sphere that rolls and bounces along the -/// [PinballGame]. +/// {@template ball_blueprint} +/// [Blueprint] which cretes a ball game object /// {@endtemplate} -class Ball extends BodyComponent with InitialPosition, Layered { - /// {@macro ball} - Ball() { - // TODO(ruimiguel): while developing Ball can be launched by clicking mouse, - // and default layer is Layer.all. But on final game Ball will be always be - // be launched from Plunger and LauncherRamp will modify it to Layer.board. - // We need to see what happens if Ball appears from other place like nest - // bumper, it will need to explicit change layer to Layer.board then. - layer = Layer.board; - } - - /// The size of the [Ball] - final Vector2 size = Vector2.all(2); +class BallBlueprint extends Blueprint { + /// {@macro ball_blueprint} + BallBlueprint({required this.position}); - @override - Future onLoad() async { - await super.onLoad(); - final sprite = await gameRef.loadSprite(Assets.images.components.ball.path); - final tint = gameRef.theme.characterTheme.ballColor.withOpacity(0.5); - await add( - SpriteComponent( - sprite: sprite, - size: size, - anchor: Anchor.center, - )..tint(tint), - ); - } + /// The initial position of the [Ball] + final Vector2 position; @override - Body createBody() { - final shape = CircleShape()..radius = size.x / 2; - - final fixtureDef = FixtureDef(shape)..density = 1; + void build(PinballGame gameRef) { + final baseColor = gameRef.theme.characterTheme.ballColor; + final ball = Ball(baseColor: baseColor)..add(BallController()); - final bodyDef = BodyDef() - ..position = initialPosition - ..userData = this - ..type = BodyType.dynamic; - - return world.createBody(bodyDef)..createFixture(fixtureDef); + add(ball..initialPosition = position + Vector2(0, ball.size.y / 2)); } +} +/// {@template ball} +/// A solid, [BodyType.dynamic] sphere that rolls and bounces along the +/// [PinballGame]. +/// {@endtemplate} +class BallController extends Component with HasGameRef { /// Removes the [Ball] from a [PinballGame]; spawning a new [Ball] if /// any are left. /// /// Triggered by [BottomWallBallContactCallback] when the [Ball] falls into /// a [BottomWall]. void lost() { - shouldRemove = true; + parent?.shouldRemove = true; final bloc = gameRef.read()..add(const BallLost()); @@ -64,19 +43,13 @@ class Ball extends BodyComponent with InitialPosition, Layered { gameRef.spawnBall(); } } +} - /// Immediatly and completly [stop]s the ball. - /// - /// The [Ball] will no longer be affected by any forces, including it's - /// weight and those emitted from collisions. - void stop() { - body.setType(BodyType.static); - } - - /// Allows the [Ball] to be affected by forces. - /// - /// If previously [stop]ed, the previous ball's velocity is not kept. - void resume() { - body.setType(BodyType.dynamic); +/// Adds helper methods to the [Ball] +extension BallX on Ball { + /// Returns the controller instance of the ball + // TODO(erickzanardo): Remove the need of an extension. + BallController get controller { + return children.whereType().first; } } diff --git a/lib/game/components/baseboard.dart b/lib/game/components/baseboard.dart index 48d38497..60d0ebe7 100644 --- a/lib/game/components/baseboard.dart +++ b/lib/game/components/baseboard.dart @@ -2,6 +2,7 @@ import 'dart:math' as math; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template baseboard} /// Straight, angled board piece to corral the [Ball] towards the [Flipper]s. diff --git a/lib/game/components/board.dart b/lib/game/components/board.dart index efa3f137..6e895d6e 100644 --- a/lib/game/components/board.dart +++ b/lib/game/components/board.dart @@ -1,5 +1,6 @@ import 'package:flame/components.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template board} /// The main flat surface of the [PinballGame], where the [Flipper]s, diff --git a/lib/game/components/bonus_word.dart b/lib/game/components/bonus_word.dart index cc6391e8..d97a9bd1 100644 --- a/lib/game/components/bonus_word.dart +++ b/lib/game/components/bonus_word.dart @@ -8,6 +8,7 @@ import 'package:flame_bloc/flame_bloc.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/material.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template bonus_word} /// Loads all [BonusLetter]s to compose a [BonusWord]. diff --git a/lib/game/components/components.dart b/lib/game/components/components.dart index a255e652..1ed293da 100644 --- a/lib/game/components/components.dart +++ b/lib/game/components/components.dart @@ -4,12 +4,10 @@ export 'board.dart'; export 'board_side.dart'; export 'bonus_word.dart'; export 'flipper.dart'; -export 'initial_position.dart'; export 'jetpack_ramp.dart'; export 'joint_anchor.dart'; export 'kicker.dart'; export 'launcher_ramp.dart'; -export 'layer.dart'; export 'pathway.dart'; export 'plunger.dart'; export 'ramp_opening.dart'; diff --git a/lib/game/components/flipper.dart b/lib/game/components/flipper.dart index 48913934..6e64c781 100644 --- a/lib/game/components/flipper.dart +++ b/lib/game/components/flipper.dart @@ -6,6 +6,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/services.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/gen/assets.gen.dart'; +import 'package:pinball_components/pinball_components.dart' hide Assets; const _leftFlipperKeys = [ LogicalKeyboardKey.arrowLeft, diff --git a/lib/game/components/jetpack_ramp.dart b/lib/game/components/jetpack_ramp.dart index 4afc36d1..a69b2111 100644 --- a/lib/game/components/jetpack_ramp.dart +++ b/lib/game/components/jetpack_ramp.dart @@ -4,6 +4,7 @@ import 'package:flame/components.dart'; import 'package:flame/extensions.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template jetpack_ramp} /// Represents the upper left blue ramp of the [Board]. diff --git a/lib/game/components/joint_anchor.dart b/lib/game/components/joint_anchor.dart index e945bd72..98b80ece 100644 --- a/lib/game/components/joint_anchor.dart +++ b/lib/game/components/joint_anchor.dart @@ -1,5 +1,5 @@ import 'package:flame_forge2d/flame_forge2d.dart'; -import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template joint_anchor} /// Non visual [BodyComponent] used to hold a [BodyType.dynamic] in [Joint]s diff --git a/lib/game/components/kicker.dart b/lib/game/components/kicker.dart index e4b2824d..dc55a52f 100644 --- a/lib/game/components/kicker.dart +++ b/lib/game/components/kicker.dart @@ -5,6 +5,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/material.dart'; import 'package:geometry/geometry.dart' as geometry show centroid; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template kicker} /// Triangular [BodyType.static] body that propels the [Ball] towards the diff --git a/lib/game/components/launcher_ramp.dart b/lib/game/components/launcher_ramp.dart index 0b6e4dbf..aae9265f 100644 --- a/lib/game/components/launcher_ramp.dart +++ b/lib/game/components/launcher_ramp.dart @@ -4,6 +4,7 @@ import 'package:flame/components.dart'; import 'package:flame/extensions.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template launcher_ramp} /// The yellow left ramp, where the [Ball] goes through when launched from the diff --git a/lib/game/components/pathway.dart b/lib/game/components/pathway.dart index 819ed5f4..54c81464 100644 --- a/lib/game/components/pathway.dart +++ b/lib/game/components/pathway.dart @@ -2,7 +2,7 @@ import 'package:flame/extensions.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/material.dart'; import 'package:geometry/geometry.dart'; -import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template pathway} /// [Pathway] creates lines of various shapes. diff --git a/lib/game/components/plunger.dart b/lib/game/components/plunger.dart index 934cd8ac..9791ec66 100644 --- a/lib/game/components/plunger.dart +++ b/lib/game/components/plunger.dart @@ -2,6 +2,7 @@ import 'package:flame/components.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/services.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template plunger} /// [Plunger] serves as a spring, that shoots the ball on the right side of the diff --git a/lib/game/components/ramp_opening.dart b/lib/game/components/ramp_opening.dart index 2d8454dd..d8ddcc35 100644 --- a/lib/game/components/ramp_opening.dart +++ b/lib/game/components/ramp_opening.dart @@ -2,6 +2,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template ramp_orientation} /// Determines if a ramp is facing [up] or [down] on the [Board]. diff --git a/lib/game/components/round_bumper.dart b/lib/game/components/round_bumper.dart index 2f43a35b..969bddbe 100644 --- a/lib/game/components/round_bumper.dart +++ b/lib/game/components/round_bumper.dart @@ -1,5 +1,6 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template round_bumper} /// Circular body that repels a [Ball] on contact, increasing the score. diff --git a/lib/game/components/score_points.dart b/lib/game/components/score_points.dart index 97cea82a..12649137 100644 --- a/lib/game/components/score_points.dart +++ b/lib/game/components/score_points.dart @@ -2,6 +2,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template score_points} /// Specifies the amount of points received on [Ball] collision. @@ -26,6 +27,8 @@ class BallScorePointsCallback extends ContactCallback { ScorePoints scorePoints, Contact _, ) { - ball.gameRef.read().add(Scored(points: scorePoints.points)); + ball.controller.gameRef.read().add( + Scored(points: scorePoints.points), + ); } } diff --git a/lib/game/components/spaceship.dart b/lib/game/components/spaceship.dart index 8243a974..847e4ac8 100644 --- a/lib/game/components/spaceship.dart +++ b/lib/game/components/spaceship.dart @@ -8,6 +8,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/flame/blueprint.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/gen/assets.gen.dart'; +import 'package:pinball_components/pinball_components.dart' hide Assets; /// A [Blueprint] which creates the spaceship feature. class Spaceship extends Forge2DBlueprint { @@ -15,7 +16,7 @@ class Spaceship extends Forge2DBlueprint { static const radius = 10.0; @override - void build() { + void build(_) { final position = Vector2( PinballGame.boardBounds.left + radius + 15, PinballGame.boardBounds.center.dy + 30, diff --git a/lib/game/components/wall.dart b/lib/game/components/wall.dart index 7475715e..0fb57a41 100644 --- a/lib/game/components/wall.dart +++ b/lib/game/components/wall.dart @@ -4,6 +4,7 @@ import 'package:flame/extensions.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:pinball/game/components/components.dart'; import 'package:pinball/game/pinball_game.dart'; +import 'package:pinball_components/pinball_components.dart'; /// {@template wall} /// A continuous generic and [BodyType.static] barrier that divides a game area. @@ -77,6 +78,6 @@ class BottomWall extends Wall { class BottomWallBallContactCallback extends ContactCallback { @override void begin(Ball ball, BottomWall wall, Contact contact) { - ball.lost(); + ball.controller.lost(); } } diff --git a/lib/game/game_assets.dart b/lib/game/game_assets.dart index d19ef177..fdc1f332 100644 --- a/lib/game/game_assets.dart +++ b/lib/game/game_assets.dart @@ -1,12 +1,13 @@ import 'package:pinball/game/game.dart'; import 'package:pinball/gen/assets.gen.dart'; +import 'package:pinball_components/pinball_components.dart' as components; /// Add methods to help loading and caching game assets. extension PinballGameAssetsX on PinballGame { /// Pre load the initial assets of the game. Future preLoadAssets() async { await Future.wait([ - images.load(Assets.images.components.ball.path), + images.load(components.Assets.images.ball.keyName), images.load(Assets.images.components.flipper.path), images.load(Assets.images.components.spaceship.androidTop.path), images.load(Assets.images.components.spaceship.androidBottom.path), diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 3ce7fd77..681a6431 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -102,11 +102,7 @@ class PinballGame extends Forge2DGame } void spawnBall() { - final ball = Ball(); - add( - ball - ..initialPosition = plunger.body.position + Vector2(0, ball.size.y / 2), - ); + addFromBlueprint(BallBlueprint(position: plunger.body.position)); } } @@ -115,8 +111,6 @@ class DebugPinballGame extends PinballGame with TapDetector { @override void onTapUp(TapUpInfo info) { - add( - Ball()..initialPosition = info.eventPosition.game, - ); + addFromBlueprint(BallBlueprint(position: info.eventPosition.game)); } } diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index fe4bad8b..ba75412b 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -15,8 +15,6 @@ class $AssetsImagesGen { class $AssetsImagesComponentsGen { const $AssetsImagesComponentsGen(); - AssetGenImage get ball => - const AssetGenImage('assets/images/components/ball.png'); AssetGenImage get flipper => const AssetGenImage('assets/images/components/flipper.png'); AssetGenImage get sauce => diff --git a/packages/pinball_components/analysis_options.yaml b/packages/pinball_components/analysis_options.yaml index 3742fc3d..f8155aa6 100644 --- a/packages/pinball_components/analysis_options.yaml +++ b/packages/pinball_components/analysis_options.yaml @@ -1 +1,4 @@ -include: package:very_good_analysis/analysis_options.2.4.0.yaml \ No newline at end of file +include: package:very_good_analysis/analysis_options.2.4.0.yaml +analyzer: + exclude: + - lib/**/*.gen.dart diff --git a/assets/images/components/ball.png b/packages/pinball_components/assets/images/ball.png similarity index 100% rename from assets/images/components/ball.png rename to packages/pinball_components/assets/images/ball.png diff --git a/packages/pinball_components/lib/gen/assets.gen.dart b/packages/pinball_components/lib/gen/assets.gen.dart new file mode 100644 index 00000000..c4ed6ca0 --- /dev/null +++ b/packages/pinball_components/lib/gen/assets.gen.dart @@ -0,0 +1,68 @@ +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +import 'package:flutter/widgets.dart'; + +class $AssetsImagesGen { + const $AssetsImagesGen(); + + AssetGenImage get ball => const AssetGenImage('assets/images/ball.png'); +} + +class Assets { + Assets._(); + + static const $AssetsImagesGen images = $AssetsImagesGen(); +} + +class AssetGenImage extends AssetImage { + const AssetGenImage(String assetName) + : super(assetName, package: 'pinball_components'); + + Image image({ + Key? key, + ImageFrameBuilder? frameBuilder, + ImageLoadingBuilder? loadingBuilder, + ImageErrorWidgetBuilder? errorBuilder, + String? semanticLabel, + bool excludeFromSemantics = false, + double? width, + double? height, + Color? color, + BlendMode? colorBlendMode, + BoxFit? fit, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, + Rect? centerSlice, + bool matchTextDirection = false, + bool gaplessPlayback = false, + bool isAntiAlias = false, + FilterQuality filterQuality = FilterQuality.low, + }) { + return Image( + key: key, + image: this, + frameBuilder: frameBuilder, + loadingBuilder: loadingBuilder, + errorBuilder: errorBuilder, + semanticLabel: semanticLabel, + excludeFromSemantics: excludeFromSemantics, + width: width, + height: height, + color: color, + colorBlendMode: colorBlendMode, + fit: fit, + alignment: alignment, + repeat: repeat, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + isAntiAlias: isAntiAlias, + filterQuality: filterQuality, + ); + } + + String get path => assetName; +} diff --git a/packages/pinball_components/lib/pinball_components.dart b/packages/pinball_components/lib/pinball_components.dart index a08579e5..b00b9d5b 100644 --- a/packages/pinball_components/lib/pinball_components.dart +++ b/packages/pinball_components/lib/pinball_components.dart @@ -1,3 +1,4 @@ library pinball_components; +export 'gen/assets.gen.dart'; export 'src/pinball_components.dart'; diff --git a/packages/pinball_components/lib/src/components/ball.dart b/packages/pinball_components/lib/src/components/ball.dart new file mode 100644 index 00000000..ec51cb47 --- /dev/null +++ b/packages/pinball_components/lib/src/components/ball.dart @@ -0,0 +1,72 @@ +import 'dart:ui'; + +import 'package:flame/components.dart'; +import 'package:flame_forge2d/flame_forge2d.dart'; +import 'package:pinball_components/pinball_components.dart'; + +/// {@template ball} +/// A solid, [BodyType.dynamic] sphere that rolls and bounces around +/// {@endtemplate} +class Ball extends BodyComponent + with Layered, InitialPosition { + /// {@macro ball_body} + Ball({ + required this.baseColor, + }) { + // TODO(ruimiguel): while developing Ball can be launched by clicking mouse, + // and default layer is Layer.all. But on final game Ball will be always be + // be launched from Plunger and LauncherRamp will modify it to Layer.board. + // We need to see what happens if Ball appears from other place like nest + // bumper, it will need to explicit change layer to Layer.board then. + layer = Layer.board; + } + + /// The size of the [Ball] + final Vector2 size = Vector2.all(2); + + /// The base [Color] used to tint this [Ball] + final Color baseColor; + + @override + Future onLoad() async { + await super.onLoad(); + final sprite = await gameRef.loadSprite(Assets.images.ball.keyName); + final tint = baseColor.withOpacity(0.5); + await add( + SpriteComponent( + sprite: sprite, + size: size, + anchor: Anchor.center, + )..tint(tint), + ); + } + + @override + Body createBody() { + final shape = CircleShape()..radius = size.x / 2; + + final fixtureDef = FixtureDef(shape)..density = 1; + + final bodyDef = BodyDef() + ..position = initialPosition + ..userData = this + ..type = BodyType.dynamic; + + return world.createBody(bodyDef)..createFixture(fixtureDef); + } + + /// Immediatly and completly [stop]s the ball. + /// + /// The [Ball] will no longer be affected by any forces, including it's + /// weight and those emitted from collisions. + void stop() { + body.setType(BodyType.static); + } + + /// Allows the [Ball] to be affected by forces. + /// + /// If previously [stop]ed, the previous ball's velocity is not kept. + void resume() { + body.setType(BodyType.dynamic); + } +} diff --git a/packages/pinball_components/lib/src/components/components.dart b/packages/pinball_components/lib/src/components/components.dart new file mode 100644 index 00000000..677bbd0c --- /dev/null +++ b/packages/pinball_components/lib/src/components/components.dart @@ -0,0 +1,3 @@ +export 'ball.dart'; +export 'initial_position.dart'; +export 'layer.dart'; diff --git a/lib/game/components/initial_position.dart b/packages/pinball_components/lib/src/components/initial_position.dart similarity index 100% rename from lib/game/components/initial_position.dart rename to packages/pinball_components/lib/src/components/initial_position.dart diff --git a/lib/game/components/layer.dart b/packages/pinball_components/lib/src/components/layer.dart similarity index 100% rename from lib/game/components/layer.dart rename to packages/pinball_components/lib/src/components/layer.dart diff --git a/packages/pinball_components/lib/src/pinball_components.dart b/packages/pinball_components/lib/src/pinball_components.dart index dbc4d6fd..003c1c49 100644 --- a/packages/pinball_components/lib/src/pinball_components.dart +++ b/packages/pinball_components/lib/src/pinball_components.dart @@ -1,7 +1 @@ -/// {@template pinball_components} -/// Package with the UI game components for the Pinball Game -/// {@endtemplate} -class PinballComponents { - /// {@macro pinball_components} - const PinballComponents(); -} +export 'components/components.dart'; diff --git a/packages/pinball_components/pubspec.yaml b/packages/pinball_components/pubspec.yaml index a3a990a0..56645a30 100644 --- a/packages/pinball_components/pubspec.yaml +++ b/packages/pinball_components/pubspec.yaml @@ -7,10 +7,24 @@ environment: sdk: ">=2.16.0 <3.0.0" dependencies: + flame: ^1.1.0-releasecandidate.6 + flame_forge2d: ^0.9.0-releasecandidate.6 flutter: sdk: flutter dev_dependencies: + flame_test: ^1.1.0 flutter_test: sdk: flutter - very_good_analysis: ^2.4.0 \ No newline at end of file + mocktail: ^0.2.0 + very_good_analysis: ^2.4.0 + +flutter: + generate: true + assets: + - assets/images/ + +flutter_gen: + line_length: 80 + assets: + package_parameter_enabled: true diff --git a/packages/pinball_components/test/helpers/helpers.dart b/packages/pinball_components/test/helpers/helpers.dart new file mode 100644 index 00000000..a8b9f7ff --- /dev/null +++ b/packages/pinball_components/test/helpers/helpers.dart @@ -0,0 +1 @@ +export 'test_game.dart'; diff --git a/packages/pinball_components/test/helpers/test_game.dart b/packages/pinball_components/test/helpers/test_game.dart new file mode 100644 index 00000000..a1219868 --- /dev/null +++ b/packages/pinball_components/test/helpers/test_game.dart @@ -0,0 +1,7 @@ +import 'package:flame_forge2d/flame_forge2d.dart'; + +class TestGame extends Forge2DGame { + TestGame() { + images.prefix = ''; + } +} diff --git a/packages/pinball_components/test/src/components/ball_test.dart b/packages/pinball_components/test/src/components/ball_test.dart new file mode 100644 index 00000000..682f1f73 --- /dev/null +++ b/packages/pinball_components/test/src/components/ball_test.dart @@ -0,0 +1,162 @@ +// ignore_for_file: cascade_invocations + +import 'package:flame_forge2d/flame_forge2d.dart'; +import 'package:flame_test/flame_test.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pinball_components/pinball_components.dart'; + +import '../../helpers/helpers.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + final flameTester = FlameTester(TestGame.new); + + group('Ball', () { + flameTester.test( + 'loads correctly', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ready(); + await game.ensureAdd(ball); + + expect(game.contains(ball), isTrue); + }, + ); + + group('body', () { + flameTester.test( + 'is dynamic', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + expect(ball.body.bodyType, equals(BodyType.dynamic)); + }, + ); + + group('can be moved', () { + flameTester.test('by its weight', (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + game.update(1); + expect(ball.body.position, isNot(equals(ball.initialPosition))); + }); + + flameTester.test('by applying velocity', (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + ball.body.gravityScale = 0; + ball.body.linearVelocity.setValues(10, 10); + game.update(1); + expect(ball.body.position, isNot(equals(ball.initialPosition))); + }); + }); + }); + + group('fixture', () { + flameTester.test( + 'exists', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + expect(ball.body.fixtures[0], isA()); + }, + ); + + flameTester.test( + 'is dense', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + final fixture = ball.body.fixtures[0]; + expect(fixture.density, greaterThan(0)); + }, + ); + + flameTester.test( + 'shape is circular', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + + final fixture = ball.body.fixtures[0]; + expect(fixture.shape.shapeType, equals(ShapeType.circle)); + expect(fixture.shape.radius, equals(1)); + }, + ); + + flameTester.test( + 'has Layer.all as default filter maskBits', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ready(); + await game.ensureAdd(ball); + await game.ready(); + + final fixture = ball.body.fixtures[0]; + expect(fixture.filterData.maskBits, equals(Layer.board.maskBits)); + }, + ); + }); + + group('stop', () { + group("can't be moved", () { + flameTester.test('by its weight', (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + ball.stop(); + + game.update(1); + expect(ball.body.position, equals(ball.initialPosition)); + }); + }); + + flameTester.test('by applying velocity', (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + ball.stop(); + + ball.body.linearVelocity.setValues(10, 10); + game.update(1); + expect(ball.body.position, equals(ball.initialPosition)); + }); + }); + + group('resume', () { + group('can move', () { + flameTester.test( + 'by its weight when previously stopped', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + ball.stop(); + ball.resume(); + + game.update(1); + expect(ball.body.position, isNot(equals(ball.initialPosition))); + }, + ); + + flameTester.test( + 'by applying velocity when previously stopped', + (game) async { + final ball = Ball(baseColor: Colors.blue); + await game.ensureAdd(ball); + ball.stop(); + ball.resume(); + + ball.body.gravityScale = 0; + ball.body.linearVelocity.setValues(10, 10); + game.update(1); + expect(ball.body.position, isNot(equals(ball.initialPosition))); + }, + ); + }); + }); + }); +} diff --git a/test/game/components/initial_position_test.dart b/packages/pinball_components/test/src/components/initial_position_test.dart similarity index 97% rename from test/game/components/initial_position_test.dart rename to packages/pinball_components/test/src/components/initial_position_test.dart index ece083cc..9f015150 100644 --- a/test/game/components/initial_position_test.dart +++ b/packages/pinball_components/test/src/components/initial_position_test.dart @@ -3,7 +3,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flame_test/flame_test.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; class TestBodyComponent extends BodyComponent with InitialPosition { @override diff --git a/test/game/components/layer_test.dart b/packages/pinball_components/test/src/components/layer_test.dart similarity index 98% rename from test/game/components/layer_test.dart rename to packages/pinball_components/test/src/components/layer_test.dart index 3aacdb49..1eaa9135 100644 --- a/test/game/components/layer_test.dart +++ b/packages/pinball_components/test/src/components/layer_test.dart @@ -4,7 +4,7 @@ import 'dart:math' as math; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flame_test/flame_test.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; class TestBodyComponent extends BodyComponent with Layered { @override diff --git a/packages/pinball_components/test/src/pinball_components_test.dart b/packages/pinball_components/test/src/pinball_components_test.dart deleted file mode 100644 index 7359ddcb..00000000 --- a/packages/pinball_components/test/src/pinball_components_test.dart +++ /dev/null @@ -1,11 +0,0 @@ -// ignore_for_file: prefer_const_constructors -import 'package:flutter_test/flutter_test.dart'; -import 'package:pinball_components/pinball_components.dart'; - -void main() { - group('PinballComponents', () { - test('can be instantiated', () { - expect(PinballComponents(), isNotNull); - }); - }); -} diff --git a/pubspec.lock b/pubspec.lock index ac5fa36d..067559c4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -392,6 +392,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + pinball_components: + dependency: "direct main" + description: + path: "packages/pinball_components" + relative: true + source: path + version: "1.0.0+1" pinball_theme: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 838dd9ed..1efe9281 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,6 +23,8 @@ dependencies: intl: ^0.17.0 leaderboard_repository: path: packages/leaderboard_repository + pinball_components: + path: packages/pinball_components pinball_theme: path: packages/pinball_theme diff --git a/test/flame/blueprint_test.dart b/test/flame/blueprint_test.dart index e521a83c..3a9f5ed3 100644 --- a/test/flame/blueprint_test.dart +++ b/test/flame/blueprint_test.dart @@ -1,5 +1,4 @@ import 'package:flame/components.dart'; -import 'package:flame/game.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/flame/blueprint.dart'; @@ -9,7 +8,7 @@ import '../helpers/helpers.dart'; class MyBlueprint extends Blueprint { @override - void build() { + void build(_) { add(Component()); addAll([Component(), Component()]); } @@ -17,7 +16,7 @@ class MyBlueprint extends Blueprint { class MyForge2dBlueprint extends Forge2DBlueprint { @override - void build() { + void build(_) { addContactCallback(MockContactCallback()); addAllContactCallback([MockContactCallback(), MockContactCallback()]); } @@ -26,7 +25,7 @@ class MyForge2dBlueprint extends Forge2DBlueprint { void main() { group('Blueprint', () { test('components can be added to it', () { - final blueprint = MyBlueprint()..build(); + final blueprint = MyBlueprint()..build(MockPinballGame()); expect(blueprint.components.length, equals(3)); }); @@ -59,7 +58,7 @@ void main() { }); test('callbacks can be added to it', () { - final blueprint = MyForge2dBlueprint()..build(); + final blueprint = MyForge2dBlueprint()..build(MockPinballGame()); expect(blueprint.callbacks.length, equals(3)); }); @@ -92,12 +91,5 @@ void main() { ); }, ); - - test('throws assertion error when used on a non Forge2dGame', () { - expect( - () => MyForge2dBlueprint().attach(FlameGame()), - throwsAssertionError, - ); - }); }); } diff --git a/test/game/components/ball_test.dart b/test/game/components/ball_test.dart index f94c1526..6419eef2 100644 --- a/test/game/components/ball_test.dart +++ b/test/game/components/ball_test.dart @@ -1,110 +1,17 @@ // ignore_for_file: cascade_invocations import 'package:bloc_test/bloc_test.dart'; -import 'package:flame_forge2d/flame_forge2d.dart'; -import 'package:flame_test/flame_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; import '../../helpers/helpers.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); - final flameTester = FlameTester(PinballGameTest.create); group('Ball', () { - flameTester.test( - 'loads correctly', - (game) async { - final ball = Ball(); - await game.ready(); - await game.ensureAdd(ball); - - expect(game.contains(ball), isTrue); - }, - ); - - group('body', () { - flameTester.test( - 'is dynamic', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - expect(ball.body.bodyType, equals(BodyType.dynamic)); - }, - ); - - group('can be moved', () { - flameTester.test('by its weight', (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - game.update(1); - expect(ball.body.position, isNot(equals(ball.initialPosition))); - }); - - flameTester.test('by applying velocity', (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - ball.body.gravityScale = 0; - ball.body.linearVelocity.setValues(10, 10); - game.update(1); - expect(ball.body.position, isNot(equals(ball.initialPosition))); - }); - }); - }); - - group('fixture', () { - flameTester.test( - 'exists', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - expect(ball.body.fixtures[0], isA()); - }, - ); - - flameTester.test( - 'is dense', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - final fixture = ball.body.fixtures[0]; - expect(fixture.density, greaterThan(0)); - }, - ); - - flameTester.test( - 'shape is circular', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - - final fixture = ball.body.fixtures[0]; - expect(fixture.shape.shapeType, equals(ShapeType.circle)); - expect(fixture.shape.radius, equals(1)); - }, - ); - - flameTester.test( - 'has Layer.all as default filter maskBits', - (game) async { - final ball = Ball(); - await game.ready(); - await game.ensureAdd(ball); - await game.ready(); - - final fixture = ball.body.fixtures[0]; - expect(fixture.filterData.maskBits, equals(Layer.board.maskBits)); - }, - ); - }); - group('lost', () { late GameBloc gameBloc; @@ -124,7 +31,7 @@ void main() { (game, tester) async { await game.ready(); - game.children.whereType().first.lost(); + game.children.whereType().first.controller.lost(); await tester.pump(); verify(() => gameBloc.add(const BallLost())).called(1); @@ -136,7 +43,7 @@ void main() { (game, tester) async { await game.ready(); - game.children.whereType().first.lost(); + game.children.whereType().first.controller.lost(); await game.ready(); // Making sure that all additions are done expect( @@ -162,7 +69,7 @@ void main() { ); await game.ready(); - game.children.whereType().first.lost(); + game.children.whereType().first.controller.lost(); await tester.pump(); expect( @@ -172,60 +79,5 @@ void main() { }, ); }); - - group('stop', () { - group("can't be moved", () { - flameTester.test('by its weight', (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - ball.stop(); - - game.update(1); - expect(ball.body.position, equals(ball.initialPosition)); - }); - }); - - flameTester.test('by applying velocity', (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - ball.stop(); - - ball.body.linearVelocity.setValues(10, 10); - game.update(1); - expect(ball.body.position, equals(ball.initialPosition)); - }); - }); - - group('resume', () { - group('can move', () { - flameTester.test( - 'by its weight when previously stopped', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - ball.stop(); - ball.resume(); - - game.update(1); - expect(ball.body.position, isNot(equals(ball.initialPosition))); - }, - ); - - flameTester.test( - 'by applying velocity when previously stopped', - (game) async { - final ball = Ball(); - await game.ensureAdd(ball); - ball.stop(); - ball.resume(); - - ball.body.gravityScale = 0; - ball.body.linearVelocity.setValues(10, 10); - game.update(1); - expect(ball.body.position, isNot(equals(ball.initialPosition))); - }, - ); - }); - }); }); } diff --git a/test/game/components/flipper_test.dart b/test/game/components/flipper_test.dart index 3c12e37e..3e6429df 100644 --- a/test/game/components/flipper_test.dart +++ b/test/game/components/flipper_test.dart @@ -4,9 +4,11 @@ import 'dart:collection'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flame_test/flame_test.dart'; +import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; import '../../helpers/helpers.dart'; @@ -81,7 +83,7 @@ void main() { final flipper = Flipper( side: BoardSide.left, ); - final ball = Ball(); + final ball = Ball(baseColor: Colors.white); await game.ready(); await game.ensureAddAll([flipper, ball]); diff --git a/test/game/components/ramp_opening_test.dart b/test/game/components/ramp_opening_test.dart index 1876f8ae..11cf8ddc 100644 --- a/test/game/components/ramp_opening_test.dart +++ b/test/game/components/ramp_opening_test.dart @@ -4,6 +4,7 @@ import 'package:flame_test/flame_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; import '../../helpers/helpers.dart'; diff --git a/test/game/components/score_points_test.dart b/test/game/components/score_points_test.dart index 9a93c078..30ec70db 100644 --- a/test/game/components/score_points_test.dart +++ b/test/game/components/score_points_test.dart @@ -1,9 +1,11 @@ +import 'package:flame/components.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; -class MockBall extends Mock implements Ball {} +import '../../helpers/helpers.dart'; class MockGameBloc extends Mock implements GameBloc {} @@ -28,12 +30,16 @@ void main() { late PinballGame game; late GameBloc bloc; late Ball ball; + late ComponentSet componentSet; + late BallController ballController; late FakeScorePoints fakeScorePoints; setUp(() { game = MockPinballGame(); bloc = MockGameBloc(); ball = MockBall(); + componentSet = MockComponentSet(); + ballController = MockBallController(); fakeScorePoints = FakeScorePoints(); }); @@ -45,7 +51,10 @@ void main() { test( 'emits Scored event with points', () { - when(() => ball.gameRef).thenReturn(game); + when(() => componentSet.whereType()) + .thenReturn([ballController]); + when(() => ball.children).thenReturn(componentSet); + when(() => ballController.gameRef).thenReturn(game); when(game.read).thenReturn(bloc); BallScorePointsCallback().begin( diff --git a/test/game/components/spaceship_test.dart b/test/game/components/spaceship_test.dart index c7eb24b2..52b12609 100644 --- a/test/game/components/spaceship_test.dart +++ b/test/game/components/spaceship_test.dart @@ -2,6 +2,7 @@ import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; import '../../helpers/helpers.dart'; diff --git a/test/game/components/wall_test.dart b/test/game/components/wall_test.dart index 53d387fa..18c7ea5b 100644 --- a/test/game/components/wall_test.dart +++ b/test/game/components/wall_test.dart @@ -17,11 +17,14 @@ void main() { test( 'removes the ball on begin contact when the wall is a bottom one', () { - final game = MockPinballGame(); final wall = MockBottomWall(); + final ballController = MockBallController(); final ball = MockBall(); + final componentSet = MockComponentSet(); - when(() => ball.gameRef).thenReturn(game); + when(() => componentSet.whereType()) + .thenReturn([ballController]); + when(() => ball.children).thenReturn(componentSet); BottomWallBallContactCallback() // Remove once https://github.com/flame-engine/flame/pull/1415 @@ -29,7 +32,7 @@ void main() { ..end(MockBall(), MockBottomWall(), MockContact()) ..begin(ball, wall, MockContact()); - verify(ball.lost).called(1); + verify(ballController.lost).called(1); }, ); }); diff --git a/test/game/pinball_game_test.dart b/test/game/pinball_game_test.dart index b9e0ac7d..65732608 100644 --- a/test/game/pinball_game_test.dart +++ b/test/game/pinball_game_test.dart @@ -5,6 +5,7 @@ import 'package:flame_test/flame_test.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; +import 'package:pinball_components/pinball_components.dart'; import '../helpers/helpers.dart'; diff --git a/test/helpers/mocks.dart b/test/helpers/mocks.dart index 1e6b7289..bd9f82cf 100644 --- a/test/helpers/mocks.dart +++ b/test/helpers/mocks.dart @@ -1,3 +1,4 @@ +import 'package:flame/components.dart'; import 'package:flame/input.dart'; import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flutter/foundation.dart'; @@ -6,6 +7,7 @@ import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:mocktail/mocktail.dart'; import 'package:pinball/game/game.dart'; import 'package:pinball/theme/theme.dart'; +import 'package:pinball_components/pinball_components.dart'; class MockPinballGame extends Mock implements PinballGame {} @@ -17,6 +19,8 @@ class MockBody extends Mock implements Body {} class MockBall extends Mock implements Ball {} +class MockBallController extends Mock implements BallController {} + class MockContact extends Mock implements Contact {} class MockContactCallback extends Mock @@ -62,3 +66,5 @@ class MockFixture extends Mock implements Fixture {} class MockSpaceshipEntrance extends Mock implements SpaceshipEntrance {} class MockSpaceshipHole extends Mock implements SpaceshipHole {} + +class MockComponentSet extends Mock implements ComponentSet {} From 6caf50edc540bcc93a5d72e7eb086bb0c3936aa6 Mon Sep 17 00:00:00 2001 From: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Date: Thu, 24 Mar 2022 08:31:21 -0500 Subject: [PATCH 3/5] fix: firestore connection (#91) --- web/__/firebase/8.9.1/firebase-firestore.js | 2 ++ web/index.html | 1 + 2 files changed, 3 insertions(+) create mode 100644 web/__/firebase/8.9.1/firebase-firestore.js diff --git a/web/__/firebase/8.9.1/firebase-firestore.js b/web/__/firebase/8.9.1/firebase-firestore.js new file mode 100644 index 00000000..b3968b7d --- /dev/null +++ b/web/__/firebase/8.9.1/firebase-firestore.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).firebase)}(this,function(mm){"use strict";try{!function(){function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var e=t(mm),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;ns[0]&&e[1]>6,c=63&c;u||(c=64,s||(h=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[h],n[c])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(function(t){for(var e=[],n=0,r=0;r>6|192:(55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128):e[n++]=i>>12|224,e[n++]=i>>6&63|128),e[n++]=63&i|128)}return e}(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n>10)),e[r++]=String.fromCharCode(56320+(1023&i))):(o=t[n++],s=t[n++],e[r++]=String.fromCharCode((15&a)<<12|(63&o)<<6|63&s))}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4),64!==a&&(r.push(s<<4&240|a>>2),64!==u&&r.push(a<<6&192|u))}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function i(){return!function(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}var u,c="FirebaseError",l=(n(f,u=Error),f);function f(t,e,n){e=u.call(this,e)||this;return e.code=t,e.customData=n,e.name=c,Object.setPrototypeOf(e,f.prototype),Error.captureStackTrace&&Error.captureStackTrace(e,d.prototype.create),e}var d=(p.prototype.create=function(t){for(var e=[],n=1;n"})):"Error",t=this.serviceName+": "+t+" ("+o+").";return new l(o,t,i)},p);function p(t,e,n){this.service=t,this.serviceName=e,this.errors=n}var m,v=/\{\$([^}]+)}/g;function w(t){return t&&t._delegate?t._delegate:t}(N=m=m||{})[N.DEBUG=0]="DEBUG",N[N.VERBOSE=1]="VERBOSE",N[N.INFO=2]="INFO",N[N.WARN=3]="WARN",N[N.ERROR=4]="ERROR",N[N.SILENT=5]="SILENT";function b(t,e){for(var n=[],r=2;r=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var N,C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},k={},R=C||self;function x(){}function O(t){var e=typeof t;return"array"==(e="object"!=e?e:t?Array.isArray(t)?"array":e:"null")||"object"==e&&"number"==typeof t.length}function L(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var P="closure_uid_"+(1e9*Math.random()>>>0),M=0;function F(t,e,n){return t.call.apply(t.bind,arguments)}function V(e,n,t){if(!e)throw Error();if(2parseFloat(dt)){ot=String(pt);break t}}ot=dt}var yt={};function gt(){return t=function(){for(var t=0,e=X(String(ot)).split("."),n=X("9").split("."),r=Math.max(e.length,n.length),i=0;0==t&&i>>0);function Vt(e){return"function"==typeof e?e:(e[Ft]||(e[Ft]=function(t){return e.handleEvent(t)}),e[Ft])}function Ut(){j.call(this),this.i=new At(this),(this.P=this).I=null}function qt(t,e){var n,r=t.I;if(r)for(n=[];r;r=r.I)n.push(r);if(t=t.P,r=e.type||e,"string"==typeof e?e=new wt(e,t):e instanceof wt?e.target=e.target||t:(s=e,rt(e=new wt(r,t),s)),s=!0,n)for(var i=n.length-1;0<=i;i--)var o=e.g=n[i],s=Bt(o,r,!0,e)&&s;if(s=Bt(o=e.g=t,r,!0,e)&&s,s=Bt(o,r,!1,e)&&s,n)for(i=0;io.length?Oe:(o=o.substr(a,s),i.C=a+s,o)))==Oe){4==e&&(t.o=4,ve(14),u=!1),le(t.j,t.m,null,"[Incomplete Response]");break}if(r==xe){t.o=4,ve(15),le(t.j,t.m,n,"[Invalid Chunk]"),u=!1;break}le(t.j,t.m,r,null),Ke(t,r)}Me(t)&&r!=Oe&&r!=xe&&(t.h.g="",t.C=0),4!=e||0!=n.length||t.h.h||(t.o=1,ve(16),u=!1),t.i=t.i&&u,u?0>4&15).toString(16)+(15&t).toString(16)}Ye.prototype.toString=function(){var t=[],e=this.j;e&&t.push(on(e,an,!0),":");var n=this.i;return!n&&"file"!=e||(t.push("//"),(e=this.s)&&t.push(on(e,an,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(on(n,"/"==n.charAt(0)?cn:un,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",on(n,ln)),t.join("")};var an=/[#\/\?@]/g,un=/[#\?:]/g,cn=/[#\?]/g,hn=/[#\?@]/g,ln=/#/g;function fn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function dn(n){n.g||(n.g=new Qe,n.h=0,n.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&He(t)))}function yn(t,e){return dn(t),e=mn(t,e),ze(t.g.h,e)}function gn(t,e,n){pn(t,e),0=t.j}function In(t){return t.h?1:t.g?t.g.size:0}function _n(t,e){return t.h?t.h==e:t.g&&t.g.has(e)}function Sn(t,e){t.g?t.g.add(e):t.h=e}function An(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Dn(t){var e,n;if(null!=t.h)return t.i.concat(t.h.D);if(null==t.g||0===t.g.size)return z(t.i);var r=t.i;try{for(var i=D(t.g.values()),o=i.next();!o.done;o=i.next())var s=o.value,r=r.concat(s.D)}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Nn(){}function Cn(){this.g=new Nn}function kn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(t){}}function Rn(t){this.l=t.$b||null,this.j=t.ib||!1}function xn(t,e){Ut.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=On,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}wn.prototype.cancel=function(){var e,t;if(this.i=Dn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){try{for(var n=D(this.g.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.g.clear()}},Nn.prototype.stringify=function(t){return R.JSON.stringify(t,void 0)},Nn.prototype.parse=function(t){return R.JSON.parse(t,void 0)},B(Rn,Te),Rn.prototype.g=function(){return new xn(this.l,this.j)},Rn.prototype.i=(bn={},function(){return bn}),B(xn,Ut);var On=0;function Ln(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Pn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Mn(t)}function Mn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(N=xn.prototype).open=function(t,e){if(this.readyState!=On)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Mn(this)},N.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;var e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||R).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},N.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Pn(this)),this.readyState=On},N.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Mn(this)),this.g&&(this.readyState=3,Mn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==R.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;Ln(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},N.Sa=function(t){var e;this.g&&(this.u&&t.value?this.response.push(t.value):this.u||(e=t.value||new Uint8Array(0),(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)),(t.done?Pn:Mn)(this),3==this.readyState&&Ln(this))},N.Ua=function(t){this.g&&(this.response=this.responseText=t,Pn(this))},N.Ta=function(t){this.g&&(this.response=t,Pn(this))},N.ha=function(){this.g&&Pn(this)},N.setRequestHeader=function(t,e){this.v.append(t,e)},N.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},N.getAllResponseHeaders=function(){if(!this.h)return"";for(var t=[],e=this.h.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(xn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Fn=R.JSON.parse;function Vn(t){Ut.call(this),this.headers=new Qe,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Un,this.K=this.L=!1}B(Vn,Ut);var Un="",qn=/^https?$/i,Bn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function Kn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,Gn(t),Hn(t)}function Gn(t){t.D||(t.D=!0,qt(t,"complete"),qt(t,"error"))}function Qn(t){if(t.h&&void 0!==k&&(!t.C[1]||4!=Wn(t)||2!=t.ba()))if(t.v&&4==Wn(t))ne(t.Fa,0,t);else if(qt(t,"readystatechange"),4==Wn(t)){t.h=!1;try{var e,n,r,i,o=t.ba();t:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var s=!0;break t;default:s=!1}if((e=s)||((n=0===o)&&(!(i=String(t.H).match(We)[1]||null)&&R.self&&R.self.location&&(i=(r=R.self.location.protocol).substr(0,r.length-1)),n=!qn.test(i?i.toLowerCase():"")),e=n),e)qt(t,"complete"),qt(t,"success");else{t.m=6;try{var a=2=r.i.j-(r.m?1:0)||(r.m?(r.l=i.D.concat(r.l),0):1==r.G||2==r.G||r.C>=(r.Xa?0:r.Ya)||(r.m=be(U(r.Ha,r,i),dr(r,r.C)),r.C++,0))))&&(2!=s||!ur(t)))switch(o&&0e.length?1:0},gi),ai=(n(yi,si=C),yi.prototype.construct=function(t,e,n){return new yi(t,e,n)},yi.prototype.canonicalString=function(){return this.toArray().join("/")},yi.prototype.toString=function(){return this.canonicalString()},yi.fromString=function(){for(var t=[],e=0;et.length&&Qr(),void 0===n?n=t.length-e:n>t.length-e&&Qr(),this.segments=t,this.offset=e,this.len=n}li.EMPTY_BYTE_STRING=new li("");var mi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function vi(t){if(Hr(!!t),"string"!=typeof t)return{seconds:wi(t.seconds),nanos:wi(t.nanos)};var e=0,n=mi.exec(t);Hr(!!n),n[1]&&(n=((n=n[1])+"000000000").substr(0,9),e=Number(n));t=new Date(t);return{seconds:Math.floor(t.getTime()/1e3),nanos:e}}function wi(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function bi(t){return"string"==typeof t?li.fromBase64String(t):li.fromUint8Array(t)}function Ei(t){return"server_timestamp"===(null===(t=((null===(t=null==t?void 0:t.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===t?void 0:t.stringValue)}function Ti(t){t=vi(t.mapValue.fields.__local_write_time__.timestampValue);return new Jr(t.seconds,t.nanos)}function Ii(t){return null==t}function _i(t){return 0===t&&1/t==-1/0}function Si(t){return"number"==typeof t&&Number.isInteger(t)&&!_i(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var Ai=(Di.fromPath=function(t){return new Di(ai.fromString(t))},Di.fromName=function(t){return new Di(ai.fromString(t).popFirst(5))},Di.prototype.hasCollectionId=function(t){return 2<=this.path.length&&this.path.get(this.path.length-2)===t},Di.prototype.isEqual=function(t){return null!==t&&0===ai.comparator(this.path,t.path)},Di.prototype.toString=function(){return this.path.toString()},Di.comparator=function(t,e){return ai.comparator(t.path,e.path)},Di.isDocumentKey=function(t){return t.length%2==0},Di.fromSegments=function(t){return new Di(new ai(t.slice()))},Di);function Di(t){this.path=t}function Ni(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ei(t)?4:10:Qr()}function Ci(r,i){var t,e,n=Ni(r);if(n!==Ni(i))return!1;switch(n){case 0:return!0;case 1:return r.booleanValue===i.booleanValue;case 4:return Ti(r).isEqual(Ti(i));case 3:return function(t){if("string"==typeof r.timestampValue&&"string"==typeof t.timestampValue&&r.timestampValue.length===t.timestampValue.length)return r.timestampValue===t.timestampValue;var e=vi(r.timestampValue),t=vi(t.timestampValue);return e.seconds===t.seconds&&e.nanos===t.nanos}(i);case 5:return r.stringValue===i.stringValue;case 6:return e=i,bi(r.bytesValue).isEqual(bi(e.bytesValue));case 7:return r.referenceValue===i.referenceValue;case 8:return t=i,wi((e=r).geoPointValue.latitude)===wi(t.geoPointValue.latitude)&&wi(e.geoPointValue.longitude)===wi(t.geoPointValue.longitude);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return wi(t.integerValue)===wi(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){t=wi(t.doubleValue),e=wi(e.doubleValue);return t===e?_i(t)===_i(e):isNaN(t)&&isNaN(e)}return!1}(r,i);case 9:return Xr(r.arrayValue.values||[],i.arrayValue.values||[],Ci);case 10:return function(){var t,e=r.mapValue.fields||{},n=i.mapValue.fields||{};if(ni(e)!==ni(n))return!1;for(t in e)if(e.hasOwnProperty(t)&&(void 0===n[t]||!Ci(e[t],n[t])))return!1;return!0}();default:return Qr()}}function ki(t,e){return void 0!==(t.values||[]).find(function(t){return Ci(t,e)})}function Ri(t,e){var n,r,i,o=Ni(t),s=Ni(e);if(o!==s)return Yr(o,s);switch(o){case 0:return 0;case 1:return Yr(t.booleanValue,e.booleanValue);case 2:return r=e,i=wi(t.integerValue||t.doubleValue),r=wi(r.integerValue||r.doubleValue),i":return 0=":return 0<=t;default:return Qr()}},Ji.prototype.g=function(){return 0<=["<","<=",">",">=","!=","not-in"].indexOf(this.op)},Ji);function Ji(t,e,n){var r=this;return(r=Xi.call(this)||this).field=t,r.op=e,r.value=n,r}var Zi,to,eo,no=(n(ao,eo=$i),ao.prototype.matches=function(t){t=Ai.comparator(t.key,this.key);return this.m(t)},ao),ro=(n(so,to=$i),so.prototype.matches=function(e){return this.keys.some(function(t){return t.isEqual(e.key)})},so),io=(n(oo,Zi=$i),oo.prototype.matches=function(e){return!this.keys.some(function(t){return t.isEqual(e.key)})},oo);function oo(t,e){var n=this;return(n=Zi.call(this,t,"not-in",e)||this).keys=uo(0,e),n}function so(t,e){var n=this;return(n=to.call(this,t,"in",e)||this).keys=uo(0,e),n}function ao(t,e,n){var r=this;return(r=eo.call(this,t,e,n)||this).key=Ai.fromName(n.referenceValue),r}function uo(t,e){return((null===(e=e.arrayValue)||void 0===e?void 0:e.values)||[]).map(function(t){return Ai.fromName(t.referenceValue)})}var co,ho,lo,fo,po=(n(To,fo=$i),To.prototype.matches=function(t){t=t.data.field(this.field);return Mi(t)&&ki(t.arrayValue,this.value)},To),yo=(n(Eo,lo=$i),Eo.prototype.matches=function(t){t=t.data.field(this.field);return null!==t&&ki(this.value.arrayValue,t)},Eo),go=(n(bo,ho=$i),bo.prototype.matches=function(t){if(ki(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;t=t.data.field(this.field);return null!==t&&!ki(this.value.arrayValue,t)},bo),mo=(n(wo,co=$i),wo.prototype.matches=function(t){var e=this,t=t.data.field(this.field);return!(!Mi(t)||!t.arrayValue.values)&&t.arrayValue.values.some(function(t){return ki(e.value.arrayValue,t)})},wo),vo=function(t,e){this.position=t,this.before=e};function wo(t,e){return co.call(this,t,"array-contains-any",e)||this}function bo(t,e){return ho.call(this,t,"not-in",e)||this}function Eo(t,e){return lo.call(this,t,"in",e)||this}function To(t,e){return fo.call(this,t,"array-contains",e)||this}function Io(t){return(t.before?"b":"a")+":"+t.position.map(Oi).join(",")}var _o=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function So(t,e,n){for(var r=0,i=0;i":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},pa=function(t,e){this.databaseId=t,this.I=e};function ya(t,e){return t.I?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function ga(t,e){return t.I?e.toBase64():e.toUint8Array()}function ma(t){return Hr(!!t),Zr.fromTimestamp((t=vi(t),new Jr(t.seconds,t.nanos)))}function va(t,e){return new ai(["projects",t.projectId,"databases",t.database]).child("documents").child(e).canonicalString()}function wa(t){t=ai.fromString(t);return Hr(Ua(t)),t}function ba(t,e){return va(t.databaseId,e.path)}function Ea(t,e){e=wa(e);if(e.get(1)!==t.databaseId.projectId)throw new Fr(Mr.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+e.get(1)+" vs "+t.databaseId.projectId);if(e.get(3)!==t.databaseId.database)throw new Fr(Mr.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+e.get(3)+" vs "+t.databaseId.database);return new Ai(Sa(e))}function Ta(t,e){return va(t.databaseId,e)}function Ia(t){t=wa(t);return 4===t.length?ai.emptyPath():Sa(t)}function _a(t){return new ai(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Sa(t){return Hr(4";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return Qr()}}(),t.fieldFilter.value)}function Va(t){switch(t.unaryFilter.op){case"IS_NAN":var e=Ma(t.unaryFilter.field);return $i.create(e,"==",{doubleValue:NaN});case"IS_NULL":e=Ma(t.unaryFilter.field);return $i.create(e,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var n=Ma(t.unaryFilter.field);return $i.create(n,"!=",{doubleValue:NaN});case"IS_NOT_NULL":n=Ma(t.unaryFilter.field);return $i.create(n,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return Qr()}}function Ua(t){return 4<=t.length&&"projects"===t.get(0)&&"databases"===t.get(2)}function qa(t){for(var e="",n=0;n",t),this.store.put(t));return _u(t)},Iu.prototype.add=function(t){return Br("SimpleDb","ADD",this.store.name,t,t),_u(this.store.add(t))},Iu.prototype.get=function(e){var n=this;return _u(this.store.get(e)).next(function(t){return Br("SimpleDb","GET",n.store.name,e,t=void 0===t?null:t),t})},Iu.prototype.delete=function(t){return Br("SimpleDb","DELETE",this.store.name,t),_u(this.store.delete(t))},Iu.prototype.count=function(){return Br("SimpleDb","COUNT",this.store.name),_u(this.store.count())},Iu.prototype.Nt=function(t,e){var e=this.cursor(this.options(t,e)),n=[];return this.xt(e,function(t,e){n.push(e)}).next(function(){return n})},Iu.prototype.Ft=function(t,e){Br("SimpleDb","DELETE ALL",this.store.name);e=this.options(t,e);e.kt=!1;e=this.cursor(e);return this.xt(e,function(t,e,n){return n.delete()})},Iu.prototype.$t=function(t,e){e?n=t:(n={},e=t);var n=this.cursor(n);return this.xt(n,e)},Iu.prototype.Ot=function(r){var t=this.cursor({});return new hu(function(n,e){t.onerror=function(t){t=Au(t.target.error);e(t)},t.onsuccess=function(t){var e=t.target.result;e?r(e.primaryKey,e.value).next(function(t){t?e.continue():n()}):n()}})},Iu.prototype.xt=function(t,i){var o=[];return new hu(function(r,e){t.onerror=function(t){e(t.target.error)},t.onsuccess=function(t){var e,n=t.target.result;n?(e=new du(n),(t=i(n.primaryKey,n.value,e))instanceof hu&&(t=t.catch(function(t){return e.done(),hu.reject(t)}),o.push(t)),e.isDone?r():null===e.Dt?n.continue():n.continue(e.Dt)):r()}}).next(function(){return hu.waitFor(o)})},Iu.prototype.options=function(t,e){var n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},Iu.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.kt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},Iu);function Iu(t){this.store=t}function _u(t){return new hu(function(e,n){t.onsuccess=function(t){t=t.target.result;e(t)},t.onerror=function(t){t=Au(t.target.error);n(t)}})}var Su=!1;function Au(t){var e=fu._t(h());if(12.2<=e&&e<13){e="An internal error was encountered in the Indexed Database server";if(0<=t.message.indexOf(e)){var n=new Fr("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+e+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Su||(Su=!0,setTimeout(function(){throw n},0)),n}}return t}var Du,Nu=(n(Cu,Du=C),Cu);function Cu(t,e){var n=this;return(n=Du.call(this)||this).Mt=t,n.currentSequenceNumber=e,n}function ku(t,e){return fu.It(t.Mt,e)}var Ru=(Fu.prototype.applyToRemoteDocument=function(t,e){for(var n,r,i,o,s,a,u=e.mutationResults,c=0;c=i),o=Gu(r.R,e)),n.done()}).next(function(){return o})},lc.prototype.getHighestUnacknowledgedBatchId=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),r=-1;return dc(t).$t({index:Ha.userMutationsIndex,range:e,reverse:!0},function(t,e,n){r=e.batchId,n.done()}).next(function(){return r})},lc.prototype.getAllMutationBatches=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return dc(t).Nt(Ha.userMutationsIndex,n).next(function(t){return t.map(function(t){return Gu(e.R,t)})})},lc.prototype.getAllMutationBatchesAffectingDocumentKey=function(o,s){var a=this,t=za.prefixForPath(this.userId,s.path),t=IDBKeyRange.lowerBound(t),u=[];return pc(o).$t({range:t},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=ja(i);if(r===a.userId&&s.path.isEqual(i))return dc(o).get(t).next(function(t){if(!t)throw Qr();Hr(t.userId===a.userId),u.push(Gu(a.R,t))});n.done()}).next(function(){return u})},lc.prototype.getAllMutationBatchesAffectingDocumentKeys=function(e,t){var s=this,a=new Ks(Yr),n=[];return t.forEach(function(o){var t=za.prefixForPath(s.userId,o.path),t=IDBKeyRange.lowerBound(t),t=pc(e).$t({range:t},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=ja(i);r===s.userId&&o.path.isEqual(i)?a=a.add(t):n.done()});n.push(t)}),hu.waitFor(n).next(function(){return s.Wt(e,a)})},lc.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var o=this,s=e.path,a=s.length+1,e=za.prefixForPath(this.userId,s),e=IDBKeyRange.lowerBound(e),u=new Ks(Yr);return pc(t).$t({range:e},function(t,e,n){var r=t[0],i=t[1],t=t[2],i=ja(i);r===o.userId&&s.isPrefixOf(i)?i.length===a&&(u=u.add(t)):n.done()}).next(function(){return o.Wt(t,u)})},lc.prototype.Wt=function(e,t){var n=this,r=[],i=[];return t.forEach(function(t){i.push(dc(e).get(t).next(function(t){if(null===t)throw Qr();Hr(t.userId===n.userId),r.push(Gu(n.R,t))}))}),hu.waitFor(i).next(function(){return r})},lc.prototype.removeMutationBatch=function(e,n){var r=this;return uc(e.Mt,this.userId,n).next(function(t){return e.addOnCommittedListener(function(){r.Gt(n.batchId)}),hu.forEach(t,function(t){return r.referenceDelegate.markPotentiallyOrphaned(e,t)})})},lc.prototype.Gt=function(t){delete this.Kt[t]},lc.prototype.performConsistencyCheck=function(e){var i=this;return this.checkEmpty(e).next(function(t){if(!t)return hu.resolve();var t=IDBKeyRange.lowerBound(za.prefixForUser(i.userId)),r=[];return pc(e).$t({range:t},function(t,e,n){t[0]===i.userId?(t=ja(t[1]),r.push(t)):n.done()}).next(function(){Hr(0===r.length)})})},lc.prototype.containsKey=function(t,e){return fc(t,this.userId,e)},lc.prototype.zt=function(t){var e=this;return yc(t).get(this.userId).next(function(t){return t||new Qa(e.userId,-1,"")})},lc);function lc(t,e,n,r){this.userId=t,this.R=e,this.Ut=n,this.referenceDelegate=r,this.Kt={}}function fc(t,o,e){var e=za.prefixForPath(o,e.path),s=e[1],e=IDBKeyRange.lowerBound(e),a=!1;return pc(t).$t({range:e,kt:!0},function(t,e,n){var r=t[0],i=t[1];t[2],r===o&&i===s&&(a=!0),n.done()}).next(function(){return a})}function dc(t){return ku(t,Ha.store)}function pc(t){return ku(t,za.store)}function yc(t){return ku(t,Qa.store)}var gc=(wc.prototype.next=function(){return this.Ht+=2,this.Ht},wc.Jt=function(){return new wc(0)},wc.Yt=function(){return new wc(-1)},wc),mc=(vc.prototype.allocateTargetId=function(n){var r=this;return this.Xt(n).next(function(t){var e=new gc(t.highestTargetId);return t.highestTargetId=e.next(),r.Zt(n,t).next(function(){return t.highestTargetId})})},vc.prototype.getLastRemoteSnapshotVersion=function(t){return this.Xt(t).next(function(t){return Zr.fromTimestamp(new Jr(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))})},vc.prototype.getHighestSequenceNumber=function(t){return this.Xt(t).next(function(t){return t.highestListenSequenceNumber})},vc.prototype.setTargetsMetadata=function(e,n,r){var i=this;return this.Xt(e).next(function(t){return t.highestListenSequenceNumber=n,r&&(t.lastRemoteSnapshotVersion=r.toTimestamp()),n>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=n),i.Zt(e,t)})},vc.prototype.addTargetData=function(e,n){var r=this;return this.te(e,n).next(function(){return r.Xt(e).next(function(t){return t.targetCount+=1,r.ee(n,t),r.Zt(e,t)})})},vc.prototype.updateTargetData=function(t,e){return this.te(t,e)},vc.prototype.removeTargetData=function(e,t){var n=this;return this.removeMatchingKeysForTargetId(e,t.targetId).next(function(){return bc(e).delete(t.targetId)}).next(function(){return n.Xt(e)}).next(function(t){return Hr(0e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},vc.prototype.getTargetCount=function(t){return this.Xt(t).next(function(t){return t.targetCount})},vc.prototype.getTargetData=function(t,r){var e=zi(r),e=IDBKeyRange.bound([e,Number.NEGATIVE_INFINITY],[e,Number.POSITIVE_INFINITY]),i=null;return bc(t).$t({range:e,index:Za.queryTargetsIndexName},function(t,e,n){e=Qu(e);Wi(r,e.target)&&(i=e,n.done())}).next(function(){return i})},vc.prototype.addMatchingKeys=function(n,t,r){var i=this,o=[],s=Tc(n);return t.forEach(function(t){var e=qa(t.path);o.push(s.put(new tu(r,e))),o.push(i.referenceDelegate.addReference(n,r,t))}),hu.waitFor(o)},vc.prototype.removeMatchingKeys=function(n,t,r){var i=this,o=Tc(n);return hu.forEach(t,function(t){var e=qa(t.path);return hu.waitFor([o.delete([r,e]),i.referenceDelegate.removeReference(n,r,t)])})},vc.prototype.removeMatchingKeysForTargetId=function(t,e){t=Tc(t),e=IDBKeyRange.bound([e],[e+1],!1,!0);return t.delete(e)},vc.prototype.getMatchingKeysForTargetId=function(t,e){var e=IDBKeyRange.bound([e],[e+1],!1,!0),t=Tc(t),r=$s();return t.$t({range:e,kt:!0},function(t,e,n){t=ja(t[1]),t=new Ai(t);r=r.add(t)}).next(function(){return r})},vc.prototype.containsKey=function(t,e){var e=qa(e.path),e=IDBKeyRange.bound([e],[$r(e)],!1,!0),i=0;return Tc(t).$t({index:tu.documentTargetsIndex,kt:!0,range:e},function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())}).next(function(){return 0h.params.maximumSequenceNumbersToCollect?(Br("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.maximumSequenceNumbersToCollect+" from "+t),h.params.maximumSequenceNumbersToCollect):t,s=Date.now(),h.nthSequenceNumber(e,i)}).next(function(t){return r=t,a=Date.now(),h.removeTargets(e,r,n)}).next(function(t){return o=t,u=Date.now(),h.removeOrphanedDocuments(e,r)}).next(function(t){return c=Date.now(),qr()<=m.DEBUG&&Br("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-l)+"ms\n\tDetermined least recently used "+i+" in "+(a-s)+"ms\n\tRemoved "+o+" targets in "+(u-a)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),hu.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:t})})},kc),Nc=(Cc.prototype.he=function(t){var n=this.de(t);return this.db.getTargetCache().getTargetCount(t).next(function(e){return n.next(function(t){return e+t})})},Cc.prototype.de=function(t){var e=0;return this.le(t,function(t){e++}).next(function(){return e})},Cc.prototype.forEachTarget=function(t,e){return this.db.getTargetCache().forEachTarget(t,e)},Cc.prototype.le=function(t,n){return this.we(t,function(t,e){return n(e)})},Cc.prototype.addReference=function(t,e,n){return Oc(t,n)},Cc.prototype.removeReference=function(t,e,n){return Oc(t,n)},Cc.prototype.removeTargets=function(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)},Cc.prototype.markPotentiallyOrphaned=Oc,Cc.prototype._e=function(t,e){return r=e,i=!1,yc(n=t).Ot(function(t){return fc(n,t,r).next(function(t){return t&&(i=!0),hu.resolve(!t)})}).next(function(){return i});var n,r,i},Cc.prototype.removeOrphanedDocuments=function(n,r){var i=this,o=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[],a=0;return this.we(n,function(e,t){t<=r&&(t=i._e(n,e).next(function(t){if(!t)return a++,o.getEntry(n,e).next(function(){return o.removeEntry(e),Tc(n).delete([0,qa(e.path)])})}),s.push(t))}).next(function(){return hu.waitFor(s)}).next(function(){return o.apply(n)}).next(function(){return a})},Cc.prototype.removeTarget=function(t,e){e=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,e)},Cc.prototype.updateLimboDocument=Oc,Cc.prototype.we=function(t,r){var i,t=Tc(t),o=Or.o;return t.$t({index:tu.documentTargetsIndex},function(t,e){var n=t[0];t[1];t=e.path,e=e.sequenceNumber;0===n?(o!==Or.o&&r(new Ai(ja(i)),o),o=e,i=t):o=Or.o}).next(function(){o!==Or.o&&r(new Ai(ja(i)),o)})},Cc.prototype.getCacheSize=function(t){return this.db.getRemoteDocumentCache().getSize(t)},Cc);function Cc(t,e){this.db=t,this.garbageCollector=new Dc(this,e)}function kc(t,e){this.ae=t,this.params=e}function Rc(t,e){this.garbageCollector=t,this.asyncQueue=e,this.oe=!1,this.ce=null}function xc(t){this.ne=t,this.buffer=new Ks(_c),this.se=0}function Oc(t,e){return Tc(t).put((t=t.currentSequenceNumber,new tu(0,qa(e.path),t)))}var Lc,Pc=(Bc.prototype.get=function(t){var e=this.mapKeyFn(t),e=this.inner[e];if(void 0!==e)for(var n=0,r=e;n "+n),1))},Xc.prototype.We=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ke=function(){t.Se.enqueueAndForget(function(){return t.inForeground="visible"===t.document.visibilityState,t.je()})},this.document.addEventListener("visibilitychange",this.ke),this.inForeground="visible"===this.document.visibilityState)},Xc.prototype.an=function(){this.ke&&(this.document.removeEventListener("visibilitychange",this.ke),this.ke=null)},Xc.prototype.Ge=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Fe=function(){e.un(),i()&&navigator.appVersion.match("Version/14")&&e.Se.enterRestrictedMode(!0),e.Se.enqueueAndForget(function(){return e.shutdown()})},this.window.addEventListener("pagehide",this.Fe))},Xc.prototype.hn=function(){this.Fe&&(this.window.removeEventListener("pagehide",this.Fe),this.Fe=null)},Xc.prototype.cn=function(t){var e;try{var n=null!==(null===(e=this.Qe)||void 0===e?void 0:e.getItem(this.on(t)));return Br("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return jr("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},Xc.prototype.un=function(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(t){jr("Failed to set zombie client id.",t)}},Xc.prototype.ln=function(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(t){}},Xc.prototype.on=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},Xc);function Xc(t,e,n,r,i,o,s,a,u,c){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Se=i,this.window=o,this.document=s,this.De=u,this.Ce=c,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Fe=null,this.inForeground=!1,this.ke=null,this.$e=null,this.Oe=Number.NEGATIVE_INFINITY,this.Me=function(t){return Promise.resolve()},!Xc.yt())throw new Fr(Mr.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Nc(this,r),this.Le=e+"main",this.R=new Lu(a),this.Be=new fu(this.Le,11,new Qc(this.R)),this.qe=new mc(this.referenceDelegate,this.R),this.Ut=new tc,this.Ue=(e=this.R,a=this.Ut,new Mc(e,a)),this.Ke=new Wu,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===c&&jr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}function $c(t){return ku(t,Ka.store)}function Jc(t){return ku(t,ru.store)}function Zc(t,e){var n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}function th(t,e){this.progress=t,this.wn=e}var eh=(uh.prototype.mn=function(e,n){var r=this;return this._n.getAllMutationBatchesAffectingDocumentKey(e,n).next(function(t){return r.yn(e,n,t)})},uh.prototype.yn=function(t,e,r){return this.Ue.getEntry(t,e).next(function(t){for(var e=0,n=r;ee?this._n[e]:null)},Bh.prototype.getHighestUnacknowledgedBatchId=function(){return hu.resolve(0===this._n.length?-1:this.ss-1)},Bh.prototype.getAllMutationBatches=function(t){return hu.resolve(this._n.slice())},Bh.prototype.getAllMutationBatchesAffectingDocumentKey=function(t,e){var n=this,r=new Sh(e,0),e=new Sh(e,Number.POSITIVE_INFINITY),i=[];return this.rs.forEachInRange([r,e],function(t){t=n.os(t.ns);i.push(t)}),hu.resolve(i)},Bh.prototype.getAllMutationBatchesAffectingDocumentKeys=function(t,e){var n=this,r=new Ks(Yr);return e.forEach(function(t){var e=new Sh(t,0),t=new Sh(t,Number.POSITIVE_INFINITY);n.rs.forEachInRange([e,t],function(t){r=r.add(t.ns)})}),hu.resolve(this.us(r))},Bh.prototype.getAllMutationBatchesAffectingQuery=function(t,e){var n=e.path,r=n.length+1,e=n;Ai.isDocumentKey(e)||(e=e.child(""));var e=new Sh(new Ai(e),0),i=new Ks(Yr);return this.rs.forEachWhile(function(t){var e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===r&&(i=i.add(t.ns)),!0)},e),hu.resolve(this.us(i))},Bh.prototype.us=function(t){var e=this,n=[];return t.forEach(function(t){t=e.os(t);null!==t&&n.push(t)}),n},Bh.prototype.removeMutationBatch=function(n,r){var i=this;Hr(0===this.hs(r.batchId,"removed")),this._n.shift();var o=this.rs;return hu.forEach(r.mutations,function(t){var e=new Sh(t.key,r.batchId);return o=o.delete(e),i.referenceDelegate.markPotentiallyOrphaned(n,t.key)}).next(function(){i.rs=o})},Bh.prototype.Gt=function(t){},Bh.prototype.containsKey=function(t,e){var n=new Sh(e,0),n=this.rs.firstAfterOrEqual(n);return hu.resolve(e.isEqual(n&&n.key))},Bh.prototype.performConsistencyCheck=function(t){return this._n.length,hu.resolve()},Bh.prototype.hs=function(t,e){return this.cs(t)},Bh.prototype.cs=function(t){return 0===this._n.length?0:t-this._n[0].batchId},Bh.prototype.os=function(t){t=this.cs(t);return t<0||t>=this._n.length?null:this._n[t]},Bh),Dh=(qh.prototype.addEntry=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,i=this.ls(e);return this.docs=this.docs.insert(r,{document:e.clone(),size:i,readTime:n}),this.size+=i-o,this.Ut.addToCollectionParentIndex(t,r.path.popLast())},qh.prototype.removeEntry=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},qh.prototype.getEntry=function(t,e){var n=this.docs.get(e);return hu.resolve(n?n.document.clone():Ki.newInvalidDocument(e))},qh.prototype.getEntries=function(t,e){var n=this,r=Qs;return e.forEach(function(t){var e=n.docs.get(t);r=r.insert(t,e?e.document.clone():Ki.newInvalidDocument(t))}),hu.resolve(r)},qh.prototype.getDocumentsMatchingQuery=function(t,e,n){for(var r=Qs,i=new Ai(e.path.child("")),o=this.docs.getIteratorFrom(i);o.hasNext();){var s=o.getNext(),a=s.key,u=s.value,s=u.document,u=u.readTime;if(!e.path.isPrefixOf(a.path))break;u.compareTo(n)<=0||Bo(e,s)&&(r=r.insert(s.key,s.clone()))}return hu.resolve(r)},qh.prototype.fs=function(t,e){return hu.forEach(this.docs,function(t){return e(t)})},qh.prototype.newChangeBuffer=function(t){return new Nh(this)},qh.prototype.getSize=function(t){return hu.resolve(this.size)},qh),Nh=(n(Uh,Th=_),Uh.prototype.applyChanges=function(n){var r=this,i=[];return this.changes.forEach(function(t,e){e.document.isValidDocument()?i.push(r.Ie.addEntry(n,e.document,r.getReadTime(t))):r.Ie.removeEntry(t)}),hu.waitFor(i)},Uh.prototype.getFromCache=function(t,e){return this.Ie.getEntry(t,e)},Uh.prototype.getAllFromCache=function(t,e){return this.Ie.getEntries(t,e)},Uh),Ch=(Vh.prototype.forEachTarget=function(t,n){return this.ds.forEach(function(t,e){return n(e)}),hu.resolve()},Vh.prototype.getLastRemoteSnapshotVersion=function(t){return hu.resolve(this.lastRemoteSnapshotVersion)},Vh.prototype.getHighestSequenceNumber=function(t){return hu.resolve(this.ws)},Vh.prototype.allocateTargetId=function(t){return this.highestTargetId=this.ys.next(),hu.resolve(this.highestTargetId)},Vh.prototype.setTargetsMetadata=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ws&&(this.ws=e),hu.resolve()},Vh.prototype.te=function(t){this.ds.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.ys=new gc(e),this.highestTargetId=e),t.sequenceNumber>this.ws&&(this.ws=t.sequenceNumber)},Vh.prototype.addTargetData=function(t,e){return this.te(e),this.targetCount+=1,hu.resolve()},Vh.prototype.updateTargetData=function(t,e){return this.te(e),hu.resolve()},Vh.prototype.removeTargetData=function(t,e){return this.ds.delete(e.target),this._s.Zn(e.targetId),--this.targetCount,hu.resolve()},Vh.prototype.removeTargets=function(n,r,i){var o=this,s=0,a=[];return this.ds.forEach(function(t,e){e.sequenceNumber<=r&&null===i.get(e.targetId)&&(o.ds.delete(t),a.push(o.removeMatchingKeysForTargetId(n,e.targetId)),s++)}),hu.waitFor(a).next(function(){return s})},Vh.prototype.getTargetCount=function(t){return hu.resolve(this.targetCount)},Vh.prototype.getTargetData=function(t,e){e=this.ds.get(e)||null;return hu.resolve(e)},Vh.prototype.addMatchingKeys=function(t,e,n){return this._s.Jn(e,n),hu.resolve()},Vh.prototype.removeMatchingKeys=function(e,t,n){this._s.Xn(t,n);var r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(function(t){i.push(r.markPotentiallyOrphaned(e,t))}),hu.waitFor(i)},Vh.prototype.removeMatchingKeysForTargetId=function(t,e){return this._s.Zn(e),hu.resolve()},Vh.prototype.getMatchingKeysForTargetId=function(t,e){e=this._s.es(e);return hu.resolve(e)},Vh.prototype.containsKey=function(t,e){return hu.resolve(this._s.containsKey(e))},Vh),kh=(Fh.prototype.start=function(){return Promise.resolve()},Fh.prototype.shutdown=function(){return this.xe=!1,Promise.resolve()},Object.defineProperty(Fh.prototype,"started",{get:function(){return this.xe},enumerable:!1,configurable:!0}),Fh.prototype.setDatabaseDeletedListener=function(){},Fh.prototype.setNetworkEnabled=function(){},Fh.prototype.getIndexManager=function(){return this.Ut},Fh.prototype.getMutationQueue=function(t){var e=this.gs[t.toKey()];return e||(e=new Ah(this.Ut,this.referenceDelegate),this.gs[t.toKey()]=e),e},Fh.prototype.getTargetCache=function(){return this.qe},Fh.prototype.getRemoteDocumentCache=function(){return this.Ue},Fh.prototype.getBundleCache=function(){return this.Ke},Fh.prototype.runTransaction=function(t,e,n){var r=this;Br("MemoryPersistence","Starting transaction:",t);var i=new Rh(this.Ne.next());return this.referenceDelegate.Es(),n(i).next(function(t){return r.referenceDelegate.Ts(i).next(function(){return t})}).toPromise().then(function(t){return i.raiseOnCommittedEvent(),t})},Fh.prototype.Is=function(e,n){return hu.or(Object.values(this.gs).map(function(t){return function(){return t.containsKey(e,n)}}))},Fh),Rh=(n(Mh,Eh=C),Mh),xh=(Ph.bs=function(t){return new Ph(t)},Object.defineProperty(Ph.prototype,"vs",{get:function(){if(this.Rs)return this.Rs;throw Qr()},enumerable:!1,configurable:!0}),Ph.prototype.addReference=function(t,e,n){return this.As.addReference(n,e),this.vs.delete(n.toString()),hu.resolve()},Ph.prototype.removeReference=function(t,e,n){return this.As.removeReference(n,e),this.vs.add(n.toString()),hu.resolve()},Ph.prototype.markPotentiallyOrphaned=function(t,e){return this.vs.add(e.toString()),hu.resolve()},Ph.prototype.removeTarget=function(t,e){var n=this;this.As.Zn(e.targetId).forEach(function(t){return n.vs.add(t.toString())});var r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(t,e.targetId).next(function(t){t.forEach(function(t){return n.vs.add(t.toString())})}).next(function(){return r.removeTargetData(t,e)})},Ph.prototype.Es=function(){this.Rs=new Set},Ph.prototype.Ts=function(n){var r=this,i=this.persistence.getRemoteDocumentCache().newChangeBuffer();return hu.forEach(this.vs,function(t){var e=Ai.fromPath(t);return r.Ps(n,e).next(function(t){t||i.removeEntry(e)})}).next(function(){return r.Rs=null,i.apply(n)})},Ph.prototype.updateLimboDocument=function(t,e){var n=this;return this.Ps(t,e).next(function(t){t?n.vs.delete(e.toString()):n.vs.add(e.toString())})},Ph.prototype.ps=function(t){return 0},Ph.prototype.Ps=function(t,e){var n=this;return hu.or([function(){return hu.resolve(n.As.containsKey(e))},function(){return n.persistence.getTargetCache().containsKey(t,e)},function(){return n.persistence.Is(t,e)}])},Ph),Oh=(Lh.prototype.isAuthenticated=function(){return null!=this.uid},Lh.prototype.toKey=function(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"},Lh.prototype.isEqual=function(t){return t.uid===this.uid},Lh);function Lh(t){this.uid=t}function Ph(t){this.persistence=t,this.As=new _h,this.Rs=null}function Mh(t){var e=this;return(e=Eh.call(this)||this).currentSequenceNumber=t,e}function Fh(t,e){var n=this;this.gs={},this.Ne=new Or(0),this.xe=!1,this.xe=!0,this.referenceDelegate=t(this),this.qe=new Ch(this),this.Ut=new Ju,this.Ue=(t=this.Ut,new Dh(t,function(t){return n.referenceDelegate.ps(t)})),this.R=new Lu(e),this.Ke=new Ih(this.R)}function Vh(t){this.persistence=t,this.ds=new Pc(zi,Wi),this.lastRemoteSnapshotVersion=Zr.min(),this.highestTargetId=0,this.ws=0,this._s=new _h,this.targetCount=0,this.ys=gc.Jt()}function Uh(t){var e=this;return(e=Th.call(this)||this).Ie=t,e}function qh(t,e){this.Ut=t,this.ls=e,this.docs=new Ms(Ai.comparator),this.size=0}function Bh(t,e){this.Ut=t,this.referenceDelegate=e,this._n=[],this.ss=1,this.rs=new Ks(Sh.Gn)}function jh(t,e){this.key=t,this.ns=e}function Kh(){this.Wn=new Ks(Sh.Gn),this.zn=new Ks(Sh.Hn)}function Gh(t){this.R=t,this.Qn=new Map,this.jn=new Map}function Qh(t,e){return"firestore_clients_"+t+"_"+e}function Hh(t,e,n){n="firestore_mutations_"+t+"_"+n;return e.isAuthenticated()&&(n+="_"+e.uid),n}function zh(t,e){return"firestore_targets_"+t+"_"+e}Oh.UNAUTHENTICATED=new Oh(null),Oh.GOOGLE_CREDENTIALS=new Oh("google-credentials-uid"),Oh.FIRST_PARTY=new Oh("first-party-uid");var Wh,Yh=(vl.Vs=function(t,e,n){var r,i=JSON.parse(n),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error);return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(r=new Fr(i.error.code,i.error.message)),o?new vl(t,e,i.state,r):(jr("SharedClientState","Failed to parse mutation state for ID '"+e+"': "+n),null)},vl.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},vl),Xh=(ml.Vs=function(t,e){var n,r=JSON.parse(e),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(n=new Fr(r.error.code,r.error.message)),i?new ml(t,r.state,n):(jr("SharedClientState","Failed to parse target state for ID '"+t+"': "+e),null)},ml.prototype.Ss=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},ml),$h=(gl.Vs=function(t,e){for(var n=JSON.parse(e),r="object"==typeof n&&n.activeTargetIds instanceof Array,i=Js,o=0;r&&othis.Bi&&(this.qi=this.Bi)},Ml.prototype.Gi=function(){null!==this.Ui&&(this.Ui.skipDelay(),this.Ui=null)},Ml.prototype.cancel=function(){null!==this.Ui&&(this.Ui.cancel(),this.Ui=null)},Ml.prototype.Wi=function(){return(Math.random()-.5)*this.qi},Ml),_=(Pl.prototype.tr=function(){return 1===this.state||2===this.state||4===this.state},Pl.prototype.er=function(){return 2===this.state},Pl.prototype.start=function(){3!==this.state?this.auth():this.nr()},Pl.prototype.stop=function(){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return this.tr()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},Pl.prototype.sr=function(){this.state=0,this.Zi.reset()},Pl.prototype.ir=function(){var t=this;this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,function(){return t.rr()}))},Pl.prototype.cr=function(t){this.ur(),this.stream.send(t)},Pl.prototype.rr=function(){return y(this,void 0,void 0,function(){return g(this,function(t){return this.er()?[2,this.close(0)]:[2]})})},Pl.prototype.ur=function(){this.Xi&&(this.Xi.cancel(),this.Xi=null)},Pl.prototype.close=function(e,n){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return this.ur(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():n&&n.code===Mr.RESOURCE_EXHAUSTED?(jr(n.toString()),jr("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):n&&n.code===Mr.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ar(),this.stream.close(),this.stream=null),this.state=e,[4,this.listener.Ri(n)];case 1:return t.sent(),[2]}})})},Pl.prototype.ar=function(){},Pl.prototype.auth=function(){var n=this;this.state=1;var t=this.hr(this.Yi),e=this.Yi;this.Ji.getToken().then(function(t){n.Yi===e&&n.lr(t)},function(e){t(function(){var t=new Fr(Mr.UNKNOWN,"Fetching auth token failed: "+e.message);return n.dr(t)})})},Pl.prototype.lr=function(t){var e=this,n=this.hr(this.Yi);this.stream=this.wr(t),this.stream.Ii(function(){n(function(){return e.state=2,e.listener.Ii()})}),this.stream.Ri(function(t){n(function(){return e.dr(t)})}),this.stream.onMessage(function(t){n(function(){return e.onMessage(t)})})},Pl.prototype.nr=function(){var t=this;this.state=4,this.Zi.ji(function(){return y(t,void 0,void 0,function(){return g(this,function(t){return this.state=0,this.start(),[2]})})})},Pl.prototype.dr=function(t){return Br("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},Pl.prototype.hr=function(e){var n=this;return function(t){n.Se.enqueueAndForget(function(){return n.Yi===e?t():(Br("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())})}},Pl),Dl=(n(Ll,Sl=_),Ll.prototype.wr=function(t){return this.Hi.Oi("Listen",t)},Ll.prototype.onMessage=function(t){this.Zi.reset();var e=function(t,e){if("targetChange"in e){e.targetChange;var n="NO_CHANGE"===(o=e.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===o?1:"REMOVE"===o?2:"CURRENT"===o?3:"RESET"===o?4:Qr(),r=e.targetChange.targetIds||[],i=(s=e.targetChange.resumeToken,t.I?(Hr(void 0===s||"string"==typeof s),li.fromBase64String(s||"")):(Hr(void 0===s||s instanceof Uint8Array),li.fromUint8Array(s||new Uint8Array))),o=(a=e.targetChange.cause)&&(u=void 0===(c=a).code?Mr.UNKNOWN:Ps(c.code),new Fr(u,c.message||"")),s=new ra(n,r,i,o||null)}else if("documentChange"in e){e.documentChange,(n=e.documentChange).document,n.document.name,n.document.updateTime;var r=Ea(t,n.document.name),i=ma(n.document.updateTime),a=new Bi({mapValue:{fields:n.document.fields}}),u=(o=Ki.newFoundDocument(r,i,a),n.targetIds||[]),c=n.removedTargetIds||[];s=new ea(u,c,o.key,o)}else if("documentDelete"in e)e.documentDelete,(n=e.documentDelete).document,r=Ea(t,n.document),i=n.readTime?ma(n.readTime):Zr.min(),a=Ki.newNoDocument(r,i),o=n.removedTargetIds||[],s=new ea([],o,a.key,a);else if("documentRemove"in e)e.documentRemove,(n=e.documentRemove).document,r=Ea(t,n.document),i=n.removedTargetIds||[],s=new ea([],i,r,null);else{if(!("filter"in e))return Qr();e.filter;e=e.filter;e.targetId,n=e.count||0,r=new As(n),i=e.targetId,s=new na(i,r)}return s}(this.R,t),t=function(t){if(!("targetChange"in t))return Zr.min();t=t.targetChange;return(!t.targetIds||!t.targetIds.length)&&t.readTime?ma(t.readTime):Zr.min()}(t);return this.listener._r(e,t)},Ll.prototype.mr=function(t){var e,n,r,i={};i.database=_a(this.R),i.addTarget=(e=this.R,(r=Yi(r=(n=t).target)?{documents:ka(e,r)}:{query:Ra(e,r)}).targetId=n.targetId,0this.query.limit;){var n=ko(this.query)?h.last():h.first(),h=h.delete(n.key),c=c.delete(n.key);a.track({type:1,doc:n})}return{fo:h,mo:a,Nn:l,mutatedKeys:c}},Of.prototype.yo=function(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations},Of.prototype.applyChanges=function(t,e,n){var o=this,r=this.fo;this.fo=t.fo,this.mutatedKeys=t.mutatedKeys;var i=t.mo.jr();i.sort(function(t,e){return r=t.type,i=e.type,n(r)-n(i)||o.lo(t.doc,e.doc);function n(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Qr()}}var r,i}),this.po(n);var s=e?this.Eo():[],n=0===this.ho.size&&this.current?1:0,e=n!==this.ao;return this.ao=n,0!==i.length||e?{snapshot:new cf(this.query,t.fo,r,i,t.mutatedKeys,0==n,e,!1),To:s}:{To:s}},Of.prototype.zr=function(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({fo:this.fo,mo:new uf,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}},Of.prototype.Io=function(t){return!this.uo.has(t)&&!!this.fo.has(t)&&!this.fo.get(t).hasLocalMutations},Of.prototype.po=function(t){var e=this;t&&(t.addedDocuments.forEach(function(t){return e.uo=e.uo.add(t)}),t.modifiedDocuments.forEach(function(t){}),t.removedDocuments.forEach(function(t){return e.uo=e.uo.delete(t)}),this.current=t.current)},Of.prototype.Eo=function(){var e=this;if(!this.current)return[];var n=this.ho;this.ho=$s(),this.fo.forEach(function(t){e.Io(t.key)&&(e.ho=e.ho.add(t.key))});var r=[];return n.forEach(function(t){e.ho.has(t)||r.push(new Df(t))}),this.ho.forEach(function(t){n.has(t)||r.push(new Af(t))}),r},Of.prototype.Ao=function(t){this.uo=t.Bn,this.ho=$s();t=this._o(t.documents);return this.applyChanges(t,!0)},Of.prototype.Ro=function(){return cf.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.ao)},Of),Cf=function(t,e,n){this.query=t,this.targetId=e,this.view=n},kf=function(t){this.key=t,this.bo=!1},Rf=(Object.defineProperty(xf.prototype,"isPrimaryClient",{get:function(){return!0===this.$o},enumerable:!1,configurable:!0}),xf);function xf(t,e,n,r,i,o){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.vo={},this.Po=new Pc(Uo,Vo),this.Vo=new Map,this.So=new Set,this.Do=new Ms(Ai.comparator),this.Co=new Map,this.No=new _h,this.xo={},this.Fo=new Map,this.ko=gc.Yt(),this.onlineState="Unknown",this.$o=void 0}function Of(t,e){this.query=t,this.uo=e,this.ao=null,this.current=!1,this.ho=$s(),this.mutatedKeys=$s(),this.lo=jo(t),this.fo=new af(this.lo)}function Lf(i,o,s,a){return y(this,void 0,void 0,function(){var e,n,r;return g(this,function(t){switch(t.label){case 0:return i.Oo=function(t,e,n){return function(r,i,o,s){return y(this,void 0,void 0,function(){var e,n;return g(this,function(t){switch(t.label){case 0:return(e=i.view._o(o)).Nn?[4,mh(r.localStore,i.query,!1).then(function(t){t=t.documents;return i.view._o(t,e)})]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return n=s&&s.targetChanges.get(i.targetId),n=i.view.applyChanges(e,r.isPrimaryClient,n),[2,(Gf(r,i.targetId,n.To),n.snapshot)]}})})}(i,t,e,n)},[4,mh(i.localStore,o,!0)];case 1:return n=t.sent(),r=new Nf(o,n.Bn),e=r._o(n.documents),n=ta.createSynthesizedTargetChangeForCurrentChange(s,a&&"Offline"!==i.onlineState),n=r.applyChanges(e,i.isPrimaryClient,n),Gf(i,s,n.To),r=new Cf(o,s,r),[2,(i.Po.set(o,r),i.Vo.has(s)?i.Vo.get(s).push(o):i.Vo.set(s,[o]),n.snapshot)]}})})}function Pf(f,d,p){return y(this,void 0,void 0,function(){var s,l;return g(this,function(t){switch(t.label){case 0:l=Zf(f),t.label=1;case 1:return t.trys.push([1,5,,6]),[4,(i=l.localStore,a=d,c=i,h=Jr.now(),o=a.reduce(function(t,e){return t.add(e.key)},$s()),c.persistence.runTransaction("Locally write mutations","readwrite",function(s){return c.Mn.pn(s,o).next(function(t){u=t;for(var e=[],n=0,r=a;n, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");n=xo(t);null!==n&&og(0,e.field,n)}t=function(t,e){for(var n=0,r=t.filters;ns.length)throw new Fr(Mr.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var a=[],u=0;u, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first argument to orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}sg.prototype.convertValue=function(t,e){switch(void 0===e&&(e="none"),Ni(t)){case 0:return null;case 1:return t.booleanValue;case 2:return wi(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(bi(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw Qr()}},sg.prototype.convertObject=function(t,n){var r=this,i={};return ri(t.fields,function(t,e){i[t]=r.convertValue(e,n)}),i},sg.prototype.convertGeoPoint=function(t){return new xp(wi(t.latitude),wi(t.longitude))},sg.prototype.convertArray=function(t,e){var n=this;return(t.values||[]).map(function(t){return n.convertValue(t,e)})},sg.prototype.convertServerTimestamp=function(t,e){switch(e){case"previous":var n=function t(e){e=e.mapValue.fields.__previous_value__;return Ei(e)?t(e):e}(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(Ti(t));default:return null}},sg.prototype.convertTimestamp=function(t){t=vi(t);return new Jr(t.seconds,t.nanos)},sg.prototype.convertDocumentKey=function(t,e){var n=ai.fromString(t);Hr(Ua(n));t=new Pd(n.get(1),n.get(3)),n=new Ai(n.popFirst(5));return t.isEqual(e)||jr("Document "+n+" contains a document reference within a different database ("+t.projectId+"/"+t.database+") which is not supported. It will be treated as a reference in the current database ("+e.projectId+"/"+e.database+") instead."),n},_=sg;function sg(){}function ag(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var ug,cg=(n(fg,ug=_),fg.prototype.convertBytes=function(t){return new kp(t)},fg.prototype.convertReference=function(t){t=this.convertDocumentKey(t,this.firestore._databaseId);return new op(this.firestore,null,t)},fg),hg=(lg.prototype.set=function(t,e,n){this._verifyNotCommitted();t=dg(t,this._firestore),e=ag(t.converter,e,n),n=zp(this._dataReader,"WriteBatch.set",t._key,e,null!==t.converter,n);return this._mutations.push(n.toMutation(t._key,ls.none())),this},lg.prototype.update=function(t,e,n){for(var r=[],i=3;iPinball + From b8f86a9976606e49e5cf0ab68be9d068cca24746 Mon Sep 17 00:00:00 2001 From: Erick Date: Thu, 24 Mar 2022 10:39:26 -0300 Subject: [PATCH 4/5] feat: adding sandbox project on pinball_components (#90) --- .../sandbox/.github/PULL_REQUEST_TEMPLATE.md | 23 + .../sandbox/.github/workflows/main.yaml | 10 + .../pinball_components/sandbox/.gitignore | 127 +++++ packages/pinball_components/sandbox/.metadata | 10 + packages/pinball_components/sandbox/LICENSE | 21 + packages/pinball_components/sandbox/README.md | 164 +++++++ .../sandbox/analysis_options.yaml | 4 + .../sandbox/coverage_badge.svg | 20 + .../sandbox/lib/common/common.dart | 11 + .../pinball_components/sandbox/lib/main.dart | 16 + .../sandbox/lib/stories/ball/ball.dart | 18 + .../sandbox/lib/stories/ball/basic.dart | 22 + .../sandbox/lib/stories/stories.dart | 1 + .../pinball_components/sandbox/pubspec.lock | 446 ++++++++++++++++++ .../pinball_components/sandbox/pubspec.yaml | 24 + .../sandbox/web/favicon.png | Bin 0 -> 917 bytes .../sandbox/web/icons/Icon-192.png | Bin 0 -> 5292 bytes .../sandbox/web/icons/Icon-512.png | Bin 0 -> 8252 bytes .../sandbox/web/icons/Icon-maskable-192.png | Bin 0 -> 5594 bytes .../sandbox/web/icons/Icon-maskable-512.png | Bin 0 -> 20998 bytes .../pinball_components/sandbox/web/index.html | 104 ++++ .../sandbox/web/manifest.json | 35 ++ 22 files changed, 1056 insertions(+) create mode 100644 packages/pinball_components/sandbox/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 packages/pinball_components/sandbox/.github/workflows/main.yaml create mode 100644 packages/pinball_components/sandbox/.gitignore create mode 100644 packages/pinball_components/sandbox/.metadata create mode 100644 packages/pinball_components/sandbox/LICENSE create mode 100644 packages/pinball_components/sandbox/README.md create mode 100644 packages/pinball_components/sandbox/analysis_options.yaml create mode 100644 packages/pinball_components/sandbox/coverage_badge.svg create mode 100644 packages/pinball_components/sandbox/lib/common/common.dart create mode 100644 packages/pinball_components/sandbox/lib/main.dart create mode 100644 packages/pinball_components/sandbox/lib/stories/ball/ball.dart create mode 100644 packages/pinball_components/sandbox/lib/stories/ball/basic.dart create mode 100644 packages/pinball_components/sandbox/lib/stories/stories.dart create mode 100644 packages/pinball_components/sandbox/pubspec.lock create mode 100644 packages/pinball_components/sandbox/pubspec.yaml create mode 100644 packages/pinball_components/sandbox/web/favicon.png create mode 100644 packages/pinball_components/sandbox/web/icons/Icon-192.png create mode 100644 packages/pinball_components/sandbox/web/icons/Icon-512.png create mode 100644 packages/pinball_components/sandbox/web/icons/Icon-maskable-192.png create mode 100644 packages/pinball_components/sandbox/web/icons/Icon-maskable-512.png create mode 100644 packages/pinball_components/sandbox/web/index.html create mode 100644 packages/pinball_components/sandbox/web/manifest.json diff --git a/packages/pinball_components/sandbox/.github/PULL_REQUEST_TEMPLATE.md b/packages/pinball_components/sandbox/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..6b9372ef --- /dev/null +++ b/packages/pinball_components/sandbox/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ + + +## Description + + + +## Type of Change + + + +- [ ] ✨ New feature (non-breaking change which adds functionality) +- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) +- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) +- [ ] 🧹 Code refactor +- [ ] ✅ Build configuration change +- [ ] 📝 Documentation +- [ ] 🗑️ Chore diff --git a/packages/pinball_components/sandbox/.github/workflows/main.yaml b/packages/pinball_components/sandbox/.github/workflows/main.yaml new file mode 100644 index 00000000..553a0091 --- /dev/null +++ b/packages/pinball_components/sandbox/.github/workflows/main.yaml @@ -0,0 +1,10 @@ +name: sandbox + +on: [pull_request, push] + +jobs: + build: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 + with: + flutter_channel: stable + flutter_version: 2.10.0 diff --git a/packages/pinball_components/sandbox/.gitignore b/packages/pinball_components/sandbox/.gitignore new file mode 100644 index 00000000..bd315f72 --- /dev/null +++ b/packages/pinball_components/sandbox/.gitignore @@ -0,0 +1,127 @@ +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/* + +# Visual Studio Code related +.classpath +.project +.settings/ +.vscode/* + +# Flutter repo-specific +/bin/cache/ +/bin/mingit/ +/dev/benchmarks/mega_gallery/ +/dev/bots/.recipe_deps +/dev/bots/android_tools/ +/dev/docs/doc/ +/dev/docs/flutter.docs.zip +/dev/docs/lib/ +/dev/docs/pubspec.yaml +/dev/integration_tests/**/xcuserdata +/dev/integration_tests/**/Pods +/packages/flutter/coverage/ +version + +# packages file containing multi-root paths +.packages.generated + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ +flutter_*.png +linked_*.ds +unlinked.ds +unlinked_spec.ds +.fvm/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java +**/android/key.properties +**/android/.idea/ +*.jks + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/.last_build_id +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Coverage +coverage/ + +# Submodules +!pubspec.lock +packages/**/pubspec.lock + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to the above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +!/dev/ci/**/Gemfile.lock +!.vscode/extensions.json +!.vscode/launch.json +!.idea/codeStyles/ +!.idea/dictionaries/ +!.idea/runConfigurations/ diff --git a/packages/pinball_components/sandbox/.metadata b/packages/pinball_components/sandbox/.metadata new file mode 100644 index 00000000..cd984dd0 --- /dev/null +++ b/packages/pinball_components/sandbox/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 + channel: stable + +project_type: app diff --git a/packages/pinball_components/sandbox/LICENSE b/packages/pinball_components/sandbox/LICENSE new file mode 100644 index 00000000..7b93245a --- /dev/null +++ b/packages/pinball_components/sandbox/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Very Good Ventures + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/pinball_components/sandbox/README.md b/packages/pinball_components/sandbox/README.md new file mode 100644 index 00000000..08509a8b --- /dev/null +++ b/packages/pinball_components/sandbox/README.md @@ -0,0 +1,164 @@ +# Sandbox + +![coverage][coverage_badge] +[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] +[![License: MIT][license_badge]][license_link] + +Generated by the [Very Good CLI][very_good_cli_link] 🤖 + +A sanbox application where components are showcased and developed in an isolated way + +--- + +## Getting Started 🚀 + +This project contains 3 flavors: + +- development +- staging +- production + +To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands: + +```sh +# Development +$ flutter run --flavor development --target lib/main_development.dart + +# Staging +$ flutter run --flavor staging --target lib/main_staging.dart + +# Production +$ flutter run --flavor production --target lib/main_production.dart +``` + +_\*Sandbox works on iOS, Android, Web, and Windows._ + +--- + +## Running Tests 🧪 + +To run all unit and widget tests use the following command: + +```sh +$ flutter test --coverage --test-randomize-ordering-seed random +``` + +To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). + +```sh +# Generate Coverage Report +$ genhtml coverage/lcov.info -o coverage/ + +# Open Coverage Report +$ open coverage/index.html +``` + +--- + +## Working with Translations 🌐 + +This project relies on [flutter_localizations][flutter_localizations_link] and follows the [official internationalization guide for Flutter][internationalization_link]. + +### Adding Strings + +1. To add a new localizable string, open the `app_en.arb` file at `lib/l10n/arb/app_en.arb`. + +```arb +{ + "@@locale": "en", + "counterAppBarTitle": "Counter", + "@counterAppBarTitle": { + "description": "Text shown in the AppBar of the Counter Page" + } +} +``` + +2. Then add a new key/value and description + +```arb +{ + "@@locale": "en", + "counterAppBarTitle": "Counter", + "@counterAppBarTitle": { + "description": "Text shown in the AppBar of the Counter Page" + }, + "helloWorld": "Hello World", + "@helloWorld": { + "description": "Hello World Text" + } +} +``` + +3. Use the new string + +```dart +import 'package:sandbox/l10n/l10n.dart'; + +@override +Widget build(BuildContext context) { + final l10n = context.l10n; + return Text(l10n.helloWorld); +} +``` + +### Adding Supported Locales + +Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info.plist` to include the new locale. + +```xml + ... + + CFBundleLocalizations + + en + es + + + ... +``` + +### Adding Translations + +1. For each supported locale, add a new ARB file in `lib/l10n/arb`. + +``` +├── l10n +│ ├── arb +│ │ ├── app_en.arb +│ │ └── app_es.arb +``` + +2. Add the translated strings to each `.arb` file: + +`app_en.arb` + +```arb +{ + "@@locale": "en", + "counterAppBarTitle": "Counter", + "@counterAppBarTitle": { + "description": "Text shown in the AppBar of the Counter Page" + } +} +``` + +`app_es.arb` + +```arb +{ + "@@locale": "es", + "counterAppBarTitle": "Contador", + "@counterAppBarTitle": { + "description": "Texto mostrado en la AppBar de la página del contador" + } +} +``` + +[coverage_badge]: coverage_badge.svg +[flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html +[internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization +[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg +[license_link]: https://opensource.org/licenses/MIT +[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg +[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis +[very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli diff --git a/packages/pinball_components/sandbox/analysis_options.yaml b/packages/pinball_components/sandbox/analysis_options.yaml new file mode 100644 index 00000000..07aa1dab --- /dev/null +++ b/packages/pinball_components/sandbox/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:very_good_analysis/analysis_options.2.4.0.yaml +linter: + rules: + public_member_api_docs: false diff --git a/packages/pinball_components/sandbox/coverage_badge.svg b/packages/pinball_components/sandbox/coverage_badge.svg new file mode 100644 index 00000000..88bfadfb --- /dev/null +++ b/packages/pinball_components/sandbox/coverage_badge.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + coverage + coverage + 100% + 100% + + \ No newline at end of file diff --git a/packages/pinball_components/sandbox/lib/common/common.dart b/packages/pinball_components/sandbox/lib/common/common.dart new file mode 100644 index 00000000..b7ee5a4a --- /dev/null +++ b/packages/pinball_components/sandbox/lib/common/common.dart @@ -0,0 +1,11 @@ +import 'package:flame_forge2d/flame_forge2d.dart'; + +String buildSourceLink(String path) { + return 'https://github.com/VGVentures/pinball/tree/main/packages/pinball_components/sandbox/lib/stories/$path'; +} + +class BasicGame extends Forge2DGame { + BasicGame() { + images.prefix = ''; + } +} diff --git a/packages/pinball_components/sandbox/lib/main.dart b/packages/pinball_components/sandbox/lib/main.dart new file mode 100644 index 00000000..0cfd6f7f --- /dev/null +++ b/packages/pinball_components/sandbox/lib/main.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2022, Very Good Ventures +// https://verygood.ventures +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. +import 'package:dashbook/dashbook.dart'; +import 'package:flutter/material.dart'; +import 'package:sandbox/stories/stories.dart'; + +void main() { + final dashbook = Dashbook(theme: ThemeData.dark()); + + addBallStories(dashbook); + runApp(dashbook); +} diff --git a/packages/pinball_components/sandbox/lib/stories/ball/ball.dart b/packages/pinball_components/sandbox/lib/stories/ball/ball.dart new file mode 100644 index 00000000..f8e49a57 --- /dev/null +++ b/packages/pinball_components/sandbox/lib/stories/ball/ball.dart @@ -0,0 +1,18 @@ +import 'package:dashbook/dashbook.dart'; +import 'package:flame/game.dart'; +import 'package:flutter/material.dart'; +import 'package:sandbox/common/common.dart'; +import 'package:sandbox/stories/ball/basic.dart'; + +void addBallStories(Dashbook dashbook) { + dashbook.storiesOf('Ball').add( + 'Basic', + (context) => GameWidget( + game: BasicBallGame( + color: context.colorProperty('color', Colors.blue), + ), + ), + codeLink: buildSourceLink('ball/basic.dart'), + info: BasicBallGame.info, + ); +} diff --git a/packages/pinball_components/sandbox/lib/stories/ball/basic.dart b/packages/pinball_components/sandbox/lib/stories/ball/basic.dart new file mode 100644 index 00000000..78948666 --- /dev/null +++ b/packages/pinball_components/sandbox/lib/stories/ball/basic.dart @@ -0,0 +1,22 @@ +import 'package:flame/input.dart'; +import 'package:flutter/material.dart'; +import 'package:pinball_components/pinball_components.dart'; +import 'package:sandbox/common/common.dart'; + +class BasicBallGame extends BasicGame with TapDetector { + BasicBallGame({ required this.color }); + + static const info = ''' + Basic example of how a Ball works, tap anywhere on the + screen to spawn a ball into the game. +'''; + + final Color color; + + @override + void onTapUp(TapUpInfo info) { + add(Ball(baseColor: color) + ..initialPosition = info.eventPosition.game, + ); + } +} diff --git a/packages/pinball_components/sandbox/lib/stories/stories.dart b/packages/pinball_components/sandbox/lib/stories/stories.dart new file mode 100644 index 00000000..6070319c --- /dev/null +++ b/packages/pinball_components/sandbox/lib/stories/stories.dart @@ -0,0 +1 @@ +export 'ball/ball.dart'; diff --git a/packages/pinball_components/sandbox/pubspec.lock b/packages/pinball_components/sandbox/pubspec.lock new file mode 100644 index 00000000..7452ccf4 --- /dev/null +++ b/packages/pinball_components/sandbox/pubspec.lock @@ -0,0 +1,446 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + dashbook: + dependency: "direct main" + description: + name: dashbook + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.7" + device_frame: + dependency: transitive + description: + name: device_frame + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + flame: + dependency: "direct main" + description: + name: flame + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-releasecandidate.6" + flame_forge2d: + dependency: "direct main" + description: + name: flame_forge2d + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0-releasecandidate.6" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_colorpicker: + dependency: transitive + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_markdown: + dependency: transitive + description: + name: flutter_markdown + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.9" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + forge2d: + dependency: transitive + description: + name: forge2d + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" + markdown: + dependency: transitive + description: + name: markdown + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + ordered_set: + dependency: transitive + description: + name: ordered_set + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + pinball_components: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "1.0.0+1" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + shared_preferences: + dependency: transitive + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.8" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + url_launcher: + dependency: transitive + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.20" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.9" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + very_good_analysis: + dependency: "direct dev" + description: + name: very_good_analysis + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.4" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+1" +sdks: + dart: ">=2.16.0 <3.0.0" + flutter: ">=2.10.0" diff --git a/packages/pinball_components/sandbox/pubspec.yaml b/packages/pinball_components/sandbox/pubspec.yaml new file mode 100644 index 00000000..0c8267a8 --- /dev/null +++ b/packages/pinball_components/sandbox/pubspec.yaml @@ -0,0 +1,24 @@ +name: sandbox +description: A sanbox application where components are showcased and developed in an isolated way +version: 1.0.0+1 +publish_to: none + +environment: + sdk: ">=2.16.0 <3.0.0" + +dependencies: + dashbook: ^0.1.7 + flame: ^1.1.0-releasecandidate.6 + flame_forge2d: ^0.9.0-releasecandidate.6 + flutter: + sdk: flutter + pinball_components: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + very_good_analysis: ^2.4.0 + +flutter: + uses-material-design: true diff --git a/packages/pinball_components/sandbox/web/favicon.png b/packages/pinball_components/sandbox/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N*SYAX-%d(5gVjrHJWqXQshj@!Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/packages/pinball_components/sandbox/web/icons/Icon-192.png b/packages/pinball_components/sandbox/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHuSu%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#g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qD2w;Z0zGsh-r zxZ13G$G<48leNqR!DCVt9)@}(zMI5w6Wo=N zpP1*3DI;~h2WDWgcKn*f!+ORD)f$DZFwgKBafEZmeXQMAsq9sxP9A)7zOYnkHT9JU zRA`umgmP9d6=PHmFIgx=0$(sjb>+0CHG)K@cPG{IxaJ&Ueo8)0RWgV9+gO7+Bl1(F z7!BslJ2MP*PWJ;x)QXbR$6jEr5q3 z(3}F@YO_P1NyTdEXRLU6fp?9V2-S=E+YaeLL{Y)W%6`k7$(EW8EZSA*(+;e5@jgD^I zaJQ2|oCM1n!A&-8`;#RDcZyk*+RPkn_r8?Ak@agHiSp*qFNX)&i21HE?yuZ;-C<3C zwJGd1lx5UzViP7sZJ&|LqH*mryb}y|%AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O!40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E!>W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/packages/pinball_components/sandbox/web/icons/Icon-512.png b/packages/pinball_components/sandbox/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbBVex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFq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mUsjUR%T!?k^(q)6FH6Af^b6 zlPg~IEwg0y;`t9y;#D+uz!oE4VP&Je!<#q*F?m5L5?J3i@!0J6q#eu z!RRU`-)HeqGi_UJZ(n~|PSNsv+Wgl{P-TvaUQ9j?ZCtvb^37U$sFpBrkT{7Jpd?HpIvj2!}RIq zH{9~+gErN2+}J`>Jvng2hwM`=PLNkc7pkjblKW|+Fk9rc)G1R>Ww>RC=r-|!m-u7( zc(a$9NG}w#PjWNMS~)o=i~WA&4L(YIW25@AL9+H9!?3Y}sv#MOdY{bb9j>p`{?O(P zIvb`n?_(gP2w3P#&91JX*md+bBEr%xUHMVqfB;(f?OPtMnAZ#rm5q5mh;a2f_si2_ z3oXWB?{NF(JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NT&#N zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/packages/pinball_components/sandbox/web/icons/Icon-maskable-192.png b/packages/pinball_components/sandbox/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9b4d76e525556d5d89141648c724331630325d GIT binary patch literal 5594 zcmdT|`#%%j|KDb2V@0DPm$^(Lx5}lO%Yv(=e*7hl@QqKS50#~#^IQPxBmuh|i9sXnt4ch@VT0F7% zMtrs@KWIOo+QV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ofJ4*{>_AIxfe-#xp>(1 z@Y3Nfd>fmqvjL;?+DmZk*KsfXJf<%~(gcLwEez%>1c6XSboURUh&k=B)MS>6kw9bY z{7vdev7;A}5fy*ZE23DS{J?8at~xwVk`pEwP5^k?XMQ7u64;KmFJ#POzdG#np~F&H ze-BUh@g54)dsS%nkBb}+GuUEKU~pHcYIg4vSo$J(J|U36bs0Use+3A&IMcR%6@jv$ z=+QI+@wW@?iu}Hpyzlvj-EYeop{f65GX0O%>w#0t|V z1-svWk`hU~m`|O$kw5?Yn5UhI%9P-<45A(v0ld1n+%Ziq&TVpBcV9n}L9Tus-TI)f zd_(g+nYCDR@+wYNQm1GwxhUN4tGMLCzDzPqY$~`l<47{+l<{FZ$L6(>J)|}!bi<)| zE35dl{a2)&leQ@LlDxLQOfUDS`;+ZQ4ozrleQwaR-K|@9T{#hB5Z^t#8 zC-d_G;B4;F#8A2EBL58s$zF-=SCr`P#z zNCTnHF&|X@q>SkAoYu>&s9v@zCpv9lLSH-UZzfhJh`EZA{X#%nqw@@aW^vPcfQrlPs(qQxmC|4tp^&sHy!H!2FH5eC{M@g;ElWNzlb-+ zxpfc0m4<}L){4|RZ>KReag2j%Ot_UKkgpJN!7Y_y3;Ssz{9 z!K3isRtaFtQII5^6}cm9RZd5nTp9psk&u1C(BY`(_tolBwzV_@0F*m%3G%Y?2utyS zY`xM0iDRT)yTyYukFeGQ&W@ReM+ADG1xu@ruq&^GK35`+2r}b^V!m1(VgH|QhIPDE X>c!)3PgKfL&lX^$Z>Cpu&6)6jvi^Z! literal 0 HcmV?d00001 diff --git a/packages/pinball_components/sandbox/web/icons/Icon-maskable-512.png b/packages/pinball_components/sandbox/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000000000000000000000000000000000000..d69c56691fbdb0b7efa65097c7cc1edac12a6d3e GIT binary patch literal 20998 zcmeFZ_gj-)&^4Nb2tlbLMU<{!p(#yjqEe+=0IA_oih%ScH9@5#MNp&}Y#;;(h=A0@ zh7{>lT2MkS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V0fI z{As5DLW^gs|B-b4C;Hd(SM-S~GQhzb>HgF2|2Usww0nL^;x@1eaB)=+Clj+$fF@H( z-fqP??~QMT$KI-#m;QC*&6vkp&8699G3)Bq0*kFZXINw=b9OVaed(3(3kS|IZ)CM? zJdnW&%t8MveBuK21uiYj)_a{Fnw0OErMzMN?d$QoPwkhOwcP&p+t>P)4tHlYw-pPN z^oJ=uc$Sl>pv@fZH~ZqxSvdhF@F1s=oZawpr^-#l{IIOGG=T%QXjtwPhIg-F@k@uIlr?J->Ia zpEUQ*=4g|XYn4Gez&aHr*;t$u3oODPmc2Ku)2Og|xjc%w;q!Zz+zY)*3{7V8bK4;& zYV82FZ+8?v)`J|G1w4I0fWdKg|2b#iaazCv;|?(W-q}$o&Y}Q5d@BRk^jL7#{kbCK zSgkyu;=DV+or2)AxCBgq-nj5=@n^`%T#V+xBGEkW4lCqrE)LMv#f;AvD__cQ@Eg3`~x| zW+h9mofSXCq5|M)9|ez(#X?-sxB%Go8};sJ?2abp(Y!lyi>k)|{M*Z$c{e1-K4ky` MPgg&ebxsLQ025IeI{*Lx literal 0 HcmV?d00001 diff --git a/packages/pinball_components/sandbox/web/index.html b/packages/pinball_components/sandbox/web/index.html new file mode 100644 index 00000000..55e4c8cc --- /dev/null +++ b/packages/pinball_components/sandbox/web/index.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + sandbox + + + + + + + diff --git a/packages/pinball_components/sandbox/web/manifest.json b/packages/pinball_components/sandbox/web/manifest.json new file mode 100644 index 00000000..8d4dbedf --- /dev/null +++ b/packages/pinball_components/sandbox/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "sandbox", + "short_name": "sandbox", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} From e2c67571d5538b4f4ff7474ac598bb95406d7fc2 Mon Sep 17 00:00:00 2001 From: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Date: Thu, 24 Mar 2022 10:01:52 -0500 Subject: [PATCH 5/5] feat: reshape `Baseboards` (#85) * refactor: removed findNested extensions (#77) * refactor: baseboard shape and position * chore: remove unused asset * test: update fixture test Co-authored-by: Alejandro Santiago --- assets/images/components/sauce.png | Bin 7862 -> 0 bytes lib/game/components/baseboard.dart | 85 +++++++++++++++-------- lib/game/components/board.dart | 4 +- lib/gen/assets.gen.dart | 2 - test/game/components/baseboard_test.dart | 4 +- 5 files changed, 60 insertions(+), 35 deletions(-) delete mode 100644 assets/images/components/sauce.png diff --git a/assets/images/components/sauce.png b/assets/images/components/sauce.png deleted file mode 100644 index 743a920a29d76879989b94e50cabf907247a9435..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7862 zcmXwebzIZm`}RQTkQg8W!U*XGX^;WZUDDm%F+!w4I;M1YcMK5e?v#)o(p>`2{CuC^ zA3N{ub;s^=pX;1+U0bAzk~9wH8%zKIfFmm-sfKt?BVJ?ZsQ*S%Hf#U@bIwLWLPb_W zf=b2J$|9)pXaWXrfaY*_y{zU6M^&6=-}-JYM_y8rdkUX|PY zJv#s>)+CdR!i*HpI*Koiaz9B(kOXg`2Y>@;b8zh!$s;33Nl7vB(n+5kPmZZtBUT&I zDy~i@p36&}eF$&?DqKHH^)cwlHgJ2hoh3KP0V-EAD;(_7JVUGKx`&%BKpg1$#{IJ8mUirx$o<`aSp z(LRUOkS4Mte+Ga2mT(VE+Yc3QkG zWke1P{fasGa4?}yKy77W>)nfu)uMixWw zsQ5;@EBiO!>JyAsu2U;*5h~DQe|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Ic<1;AT9 z$VB)c$A8@p# _createFixtureDefs() { final fixturesDef = []; + final direction = _side.direction; + final arcsAngle = -1.11 * direction; + const arcsRotation = math.pi / 2.08; + + final topCircleShape = CircleShape()..radius = 0.7; + topCircleShape.position.setValues(11.39 * direction, 6.05); + final topCircleFixtureDef = FixtureDef(topCircleShape); + fixturesDef.add(topCircleFixtureDef); + + final innerEdgeShape = EdgeShape() + ..set( + Vector2(10.86 * direction, 6.45), + Vector2(6.96 * direction, 0.25), + ); + final innerEdgeShapeFixtureDef = FixtureDef(innerEdgeShape); + fixturesDef.add(innerEdgeShapeFixtureDef); + + final outerEdgeShape = EdgeShape() + ..set( + Vector2(11.96 * direction, 5.85), + Vector2(5.48 * direction, -4.85), + ); + final outerEdgeShapeFixtureDef = FixtureDef(outerEdgeShape); + fixturesDef.add(outerEdgeShapeFixtureDef); + + final upperArcFixtureDefs = Pathway.arc( + center: Vector2(1.76 * direction, 3.25), + width: 0, + radius: 6.1, + angle: arcsAngle, + rotation: arcsRotation, + singleWall: true, + ).createFixtureDefs(); + fixturesDef.addAll(upperArcFixtureDefs); + + final lowerArcFixtureDefs = Pathway.arc( + center: Vector2(1.85 * direction, -2.15), + width: 0, + radius: 4.5, + angle: arcsAngle, + rotation: arcsRotation, + singleWall: true, + ).createFixtureDefs(); + fixturesDef.addAll(lowerArcFixtureDefs); - final circleShape1 = CircleShape()..radius = Baseboard.height / 2; - circleShape1.position.setValues( - -(Baseboard.width / 2) + circleShape1.radius, - 0, - ); - final circle1FixtureDef = FixtureDef(circleShape1); - fixturesDef.add(circle1FixtureDef); - - final circleShape2 = CircleShape()..radius = Baseboard.height / 2; - circleShape2.position.setValues( - (Baseboard.width / 2) - circleShape2.radius, - 0, - ); - final circle2FixtureDef = FixtureDef(circleShape2); - fixturesDef.add(circle2FixtureDef); - - final rectangle = PolygonShape() - ..setAsBoxXY( - (Baseboard.width - Baseboard.height) / 2, - Baseboard.height / 2, + final bottomRectangle = PolygonShape() + ..setAsBox( + 7, + 2, + Vector2(-5.14 * direction, -4.75), + 0, ); - final rectangleFixtureDef = FixtureDef(rectangle); - fixturesDef.add(rectangleFixtureDef); + final bottomRectangleFixtureDef = FixtureDef(bottomRectangle); + fixturesDef.add(bottomRectangleFixtureDef); return fixturesDef; } @@ -56,7 +83,7 @@ class Baseboard extends BodyComponent with InitialPosition { Body createBody() { // TODO(allisonryan0002): share sweeping angle with flipper when components // are grouped. - const angle = math.pi / 7; + const angle = math.pi / 5; final bodyDef = BodyDef() ..position = initialPosition diff --git a/lib/game/components/board.dart b/lib/game/components/board.dart index 6e895d6e..adfbef49 100644 --- a/lib/game/components/board.dart +++ b/lib/game/components/board.dart @@ -134,8 +134,8 @@ class _BottomGroupSide extends Component { final baseboard = Baseboard(side: _side) ..initialPosition = _position + Vector2( - (Flipper.size.x * direction) - direction, - Flipper.size.y, + (Baseboard.size.x / 1.6 * direction), + Baseboard.size.y - 2, ); final kicker = Kicker( side: _side, diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index ba75412b..6e81fe77 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -17,8 +17,6 @@ class $AssetsImagesComponentsGen { AssetGenImage get flipper => const AssetGenImage('assets/images/components/flipper.png'); - AssetGenImage get sauce => - const AssetGenImage('assets/images/components/sauce.png'); $AssetsImagesComponentsSpaceshipGen get spaceship => const $AssetsImagesComponentsSpaceshipGen(); } diff --git a/test/game/components/baseboard_test.dart b/test/game/components/baseboard_test.dart index 75cc62cc..f834a41e 100644 --- a/test/game/components/baseboard_test.dart +++ b/test/game/components/baseboard_test.dart @@ -61,14 +61,14 @@ void main() { group('fixtures', () { flameTester.test( - 'has three', + 'has six', (game) async { final baseboard = Baseboard( side: BoardSide.left, ); await game.ensureAdd(baseboard); - expect(baseboard.body.fixtures.length, equals(3)); + expect(baseboard.body.fixtures.length, equals(6)); }, ); });