diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 53291cc..8bc0ae4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,6 @@ import { Component, signal, type WritableSignal } from '@angular/core'; import { RouterOutlet } from '@angular/router'; -import { NotificationComponent } from "./common/components/notification/notification.component"; +import { NotificationComponent } from './common/components/notification/notification.component'; @Component({ selector: 'app-root', diff --git a/src/app/common/components/notification/notification.component.ts b/src/app/common/components/notification/notification.component.ts index d2076ca..9c426ca 100644 --- a/src/app/common/components/notification/notification.component.ts +++ b/src/app/common/components/notification/notification.component.ts @@ -1,13 +1,11 @@ import { ChangeDetectionStrategy, Component, input, signal } from '@angular/core'; @Component({ - selector: 'app-notification', - standalone: true, - imports: [], - templateUrl: './notification.component.html', - styleUrl: './notification.component.scss', - changeDetection: ChangeDetectionStrategy.OnPush + selector: 'app-notification', + standalone: true, + imports: [], + templateUrl: './notification.component.html', + styleUrl: './notification.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush }) -export class NotificationComponent { - -} +export class NotificationComponent {} diff --git a/src/app/game/actors/spectator.ts b/src/app/game/actors/spectator.ts index e872735..dd913c6 100644 --- a/src/app/game/actors/spectator.ts +++ b/src/app/game/actors/spectator.ts @@ -1,4 +1,13 @@ -import { Actor, CollisionType, type Vector, toRadians, vec, type CollisionStartEvent, type Sound, Collider, CircleCollider } from 'excalibur'; +import { + Actor, + CollisionType, + type Vector, + toRadians, + vec, + type CollisionStartEvent, + type Sound, + CircleCollider +} from 'excalibur'; import { Config } from '../config'; import { Skier } from './skier'; import type { Game } from '../game'; @@ -14,7 +23,7 @@ export class Spectator extends Actor { height: Config.SPECTATOR_HEIGHT, rotation: toRadians(rotation), collisionType: CollisionType.Active, - collider: new CircleCollider({ radius: 10, offset: vec(-1, 1)}) + collider: new CircleCollider({ radius: 10, offset: vec(-1, 1) }) }); const randomizer = Math.random(); diff --git a/src/app/game/game.ts b/src/app/game/game.ts index ac3e318..6af0bcf 100644 --- a/src/app/game/game.ts +++ b/src/app/game/game.ts @@ -105,8 +105,8 @@ export class Game extends Engine { if (_engine.input.keyboard.wasPressed(Config.KEYBOARD_GHOST_KEY)) { this.settingsService.setGhosts(!this.settingsService.getSettings().ghosts); } - } - + } + public stopProperly(): void { this.stop(); (this.currentScene as Race).cleanRace(); diff --git a/src/app/pages/race/race.component.ts b/src/app/pages/race/race.component.ts index 23b5186..6f1a27b 100644 --- a/src/app/pages/race/race.component.ts +++ b/src/app/pages/race/race.component.ts @@ -76,7 +76,7 @@ class RaceRanking { styleUrl: './race.component.scss', changeDetection: ChangeDetectionStrategy.OnPush }) -export class RaceComponent extends Destroyable implements OnInit, OnDestroy{ +export class RaceComponent extends Destroyable implements OnInit, OnDestroy { private router = inject(Router); private localEventService = inject(LocalEventService); private trackService = inject(TrackService); @@ -111,7 +111,7 @@ export class RaceComponent extends Destroyable implements OnInit, OnDestroy{ } public override ngOnDestroy(): void { - this.game?.stopProperly(); + this.game?.stopProperly(); } protected exitRace(): void { @@ -142,7 +142,8 @@ export class RaceComponent extends Destroyable implements OnInit, OnDestroy{ tap(result => (raceResult = result)), tap(result => this.localEventService.addEventResult(result)), map( - result => new StockableRecord(this.raceConfig()!.track.id!, result.rider, result.date, result.timing) + result => + new StockableRecord(this.raceConfig()!.track.id!, result.rider, result.date, result.timing) ), switchMap(result => this.trackService.addTrackRecord$(result)), switchMap(() => this.trackService.getTrackRecords$(this.raceConfig()!.track.id!)),