format codebase with prettier

This commit is contained in:
Evan
2025-01-30 19:46:36 -08:00
parent cd121a5cd4
commit 4ee37323f9
98 changed files with 12191 additions and 10234 deletions
+30 -9
View File
@@ -2,31 +2,46 @@ import { EventBus, GameEvent } from "../core/EventBus";
import { Game } from "../core/game/Game";
export class MouseUpEvent implements GameEvent {
constructor(public readonly x: number, public readonly y: number) {}
constructor(
public readonly x: number,
public readonly y: number,
) {}
}
export class MouseDownEvent implements GameEvent {
constructor(public readonly x: number, public readonly y: number) {}
constructor(
public readonly x: number,
public readonly y: number,
) {}
}
export class MouseMoveEvent implements GameEvent {
constructor(public readonly x: number, public readonly y: number) {}
constructor(
public readonly x: number,
public readonly y: number,
) {}
}
export class ContextMenuEvent implements GameEvent {
constructor(public readonly x: number, public readonly y: number) {}
constructor(
public readonly x: number,
public readonly y: number,
) {}
}
export class ZoomEvent implements GameEvent {
constructor(
public readonly x: number,
public readonly y: number,
public readonly delta: number
public readonly delta: number,
) {}
}
export class DragEvent implements GameEvent {
constructor(public readonly deltaX: number, public readonly deltaY: number) {}
constructor(
public readonly deltaX: number,
public readonly deltaY: number,
) {}
}
export class AlternateViewEvent implements GameEvent {
@@ -36,7 +51,10 @@ export class AlternateViewEvent implements GameEvent {
export class RefreshGraphicsEvent implements GameEvent {}
export class ShowBuildMenuEvent implements GameEvent {
constructor(public readonly x: number, public readonly y: number) {}
constructor(
public readonly x: number,
public readonly y: number,
) {}
}
export class InputHandler {
@@ -54,7 +72,10 @@ export class InputHandler {
private alternateView = false;
constructor(private canvas: HTMLCanvasElement, private eventBus: EventBus) {}
constructor(
private canvas: HTMLCanvasElement,
private eventBus: EventBus,
) {}
initialize() {
this.canvas.addEventListener("pointerdown", (e) => this.onPointerDown(e));
@@ -175,7 +196,7 @@ export class InputHandler {
// Threshold to avoid tiny zoom adjustments
const zoomCenter = this.getPinchCenter();
this.eventBus.emit(
new ZoomEvent(zoomCenter.x, zoomCenter.y, -pinchDelta * 2)
new ZoomEvent(zoomCenter.x, zoomCenter.y, -pinchDelta * 2),
);
this.lastPinchDistance = currentPinchDistance;
}