From c29ce6e9a932de9cdef37406eab0d8278ea1ff69 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Mon, 7 Feb 2022 14:23:34 +0100 Subject: [PATCH] prettier --- front/src/Phaser/Entity/Character.ts | 18 +++++++++++++----- front/src/Phaser/Game/ActivatablesManager.ts | 6 ++++-- front/src/Stores/OutlineColorStore.ts | 1 - 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/front/src/Phaser/Entity/Character.ts b/front/src/Phaser/Entity/Character.ts index 061bc2e5..b411eee7 100644 --- a/front/src/Phaser/Entity/Character.ts +++ b/front/src/Phaser/Entity/Character.ts @@ -163,12 +163,20 @@ export abstract class Character extends Container implements OutlineableInterfac * Returns position based on where player is currently facing * @param shift How far from player should the point of interest be. */ - public getDirectionalActivationPosition(shift: number): { x: number, y: number } { + public getDirectionalActivationPosition(shift: number): { x: number; y: number } { switch (this.lastDirection) { - case PlayerAnimationDirections.Down: { return { x: this.x, y: this.y + shift }; } - case PlayerAnimationDirections.Left: { return { x: this.x - shift, y: this.y }; } - case PlayerAnimationDirections.Right: { return { x: this.x + shift, y: this.y }; } - case PlayerAnimationDirections.Up: { return { x: this.x, y: this.y - shift }; } + case PlayerAnimationDirections.Down: { + return { x: this.x, y: this.y + shift }; + } + case PlayerAnimationDirections.Left: { + return { x: this.x - shift, y: this.y }; + } + case PlayerAnimationDirections.Right: { + return { x: this.x + shift, y: this.y }; + } + case PlayerAnimationDirections.Up: { + return { x: this.x, y: this.y - shift }; + } } } diff --git a/front/src/Phaser/Game/ActivatablesManager.ts b/front/src/Phaser/Game/ActivatablesManager.ts index f136de7c..74c637d7 100644 --- a/front/src/Phaser/Game/ActivatablesManager.ts +++ b/front/src/Phaser/Game/ActivatablesManager.ts @@ -73,7 +73,9 @@ export class ActivatablesManager { } public updateActivatableObjectsDistances(objects: ActivatableInterface[]): void { - const currentPlayerPos = this.currentPlayer.getDirectionalActivationPosition(this.directionalActivationPositionShift); + const currentPlayerPos = this.currentPlayer.getDirectionalActivationPosition( + this.directionalActivationPositionShift + ); for (const object of objects) { const distance = MathUtils.distanceBetween(currentPlayerPos, object.getPosition()); this.activatableObjectsDistances.set(object, distance); @@ -85,7 +87,7 @@ export class ActivatablesManager { object, MathUtils.distanceBetween( this.currentPlayer.getDirectionalActivationPosition(this.directionalActivationPositionShift), - object.getPosition(), + object.getPosition() ) ); } diff --git a/front/src/Stores/OutlineColorStore.ts b/front/src/Stores/OutlineColorStore.ts index 97a443e1..8ecd7293 100644 --- a/front/src/Stores/OutlineColorStore.ts +++ b/front/src/Stores/OutlineColorStore.ts @@ -8,7 +8,6 @@ export function createColorStore() { let pointedByPointer: number | undefined = undefined; let pointedByCharacter: number | undefined = undefined; - const updateColor = () => { set(pointedByPointer ?? pointedByCharacter ?? followColor ?? apiColor); };