Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Hermann committed Nov 14, 2024
1 parent 83faa34 commit 93c486f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
16 changes: 7 additions & 9 deletions src/app/common/components/notification/notification.component.ts
Original file line number Diff line number Diff line change
@@ -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 {}
13 changes: 11 additions & 2 deletions src/app/game/actors/spectator.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 4 additions & 3 deletions src/app/pages/race/race.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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!)),
Expand Down

0 comments on commit 93c486f

Please sign in to comment.