From c54a32b80ee9c7f74a824cf308db6e5dcb5199e6 Mon Sep 17 00:00:00 2001 From: Rafael Almeida Barbosa Date: Thu, 2 May 2024 00:20:11 -0300 Subject: [PATCH] format code --- lib/input/player_controller.dart | 6 ++++-- lib/map/spritefusion/world_map_by_spritefusion.dart | 6 ++---- lib/mixins/attackable.dart | 2 +- lib/objects/flying_attack_game_object.dart | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/input/player_controller.dart b/lib/input/player_controller.dart index abd287411..da1366fca 100644 --- a/lib/input/player_controller.dart +++ b/lib/input/player_controller.dart @@ -15,8 +15,10 @@ enum JoystickMoveDirectional { MOVE_LEFT, IDLE; - bool get isLeft => this == MOVE_LEFT || this == MOVE_DOWN_LEFT || this == MOVE_UP_LEFT; - bool get isRight => this == MOVE_RIGHT || this == MOVE_DOWN_RIGHT || this == MOVE_UP_RIGHT; + bool get isLeft => + this == MOVE_LEFT || this == MOVE_DOWN_LEFT || this == MOVE_UP_LEFT; + bool get isRight => + this == MOVE_RIGHT || this == MOVE_DOWN_RIGHT || this == MOVE_UP_RIGHT; } class JoystickDirectionalEvent { diff --git a/lib/map/spritefusion/world_map_by_spritefusion.dart b/lib/map/spritefusion/world_map_by_spritefusion.dart index bb2efb482..331a63b5e 100644 --- a/lib/map/spritefusion/world_map_by_spritefusion.dart +++ b/lib/map/spritefusion/world_map_by_spritefusion.dart @@ -9,14 +9,14 @@ class WorldMapBySpritefusion extends WorldMap { WorldMapReader reader, { ValueChanged? onError, double sizeToUpdate = 0, - Map? objectsBuilder + Map? objectsBuilder, }) : super(const []) { this.sizeToUpdate = sizeToUpdate; _builder = SpritefusionWorldBuilder( reader, onError: onError, sizeToUpdate: sizeToUpdate, - objectsBuilder:objectsBuilder, + objectsBuilder: objectsBuilder, ); } @@ -28,5 +28,3 @@ class WorldMapBySpritefusion extends WorldMap { return super.onLoad(); } } - - diff --git a/lib/mixins/attackable.dart b/lib/mixins/attackable.dart index d73ed6633..f551d8346 100644 --- a/lib/mixins/attackable.dart +++ b/lib/mixins/attackable.dart @@ -89,7 +89,7 @@ mixin Attackable on GameComponent { /// This method is used to check if this component can receive damage from any attacker. bool checkCanReceiveDamage(AttackOriginEnum attacker) { - if (isDead) return false; + if (isDead || isRemoving) return false; switch (receivesAttackFrom) { case AcceptableAttackOriginEnum.ALL: return true; diff --git a/lib/objects/flying_attack_game_object.dart b/lib/objects/flying_attack_game_object.dart index 5582b8d95..a276b5653 100644 --- a/lib/objects/flying_attack_game_object.dart +++ b/lib/objects/flying_attack_game_object.dart @@ -122,7 +122,7 @@ class FlyingAttackGameObject extends AnimatedGameObject @override void onCollision(Set intersectionPoints, PositionComponent other) { - if (other is Attackable && !other.isRemoving && animationDestroy == null) { + if (other is Attackable && animationDestroy == null) { other.receiveDamage(attackFrom, damage, id); } if (other is GameComponent) {