diff --git a/src/lib/game/actions/action.ts b/src/lib/game/actions/action.ts
index 261ec351..2ef0aaf9 100644
--- a/src/lib/game/actions/action.ts
+++ b/src/lib/game/actions/action.ts
@@ -1,4 +1,4 @@
-import type { IGameAction, IGameActionResponse, } from "$lib/game/types"
+import type { IGameAction, IGameActionResponse } from "$lib/game/types"
import type { Player } from "../objects/units"
interface IActionOptions {
diff --git a/src/lib/game/actions/donateWoodToVillageAction.ts b/src/lib/game/actions/donateWoodToVillageAction.ts
index 917b75b6..168e59d4 100644
--- a/src/lib/game/actions/donateWoodToVillageAction.ts
+++ b/src/lib/game/actions/donateWoodToVillageAction.ts
@@ -1,9 +1,9 @@
+import { ANSWER } from "$lib/game/services/actionService"
import { Village } from "../chunks"
import type { Warehouse } from "../objects/buildings/warehouse"
import type { Player } from "../objects/units"
import type { GameScene } from "../scenes/gameScene"
import { Action } from "./action"
-import { ANSWER } from "$lib/game/services/actionService";
interface IDonateWoodToVillageActionOptions {
scene: GameScene
diff --git a/src/lib/game/actions/plantTreeAction.ts b/src/lib/game/actions/plantTreeAction.ts
index 1578f8ac..19feb621 100644
--- a/src/lib/game/actions/plantTreeAction.ts
+++ b/src/lib/game/actions/plantTreeAction.ts
@@ -1,9 +1,9 @@
+import { ANSWER } from "$lib/game/services/actionService"
import { Village } from "../chunks"
import type { Player } from "../objects/units"
import type { GameScene } from "../scenes/gameScene"
import { PlantNewTreeScript } from "../scripts/plantNewTreeScript"
import { Action } from "./action"
-import { ANSWER } from "$lib/game/services/actionService";
interface IPlantTreeActionOptions {
scene: GameScene
diff --git a/src/lib/game/actions/voteAction.ts b/src/lib/game/actions/voteAction.ts
index bec1a52c..58d6d596 100644
--- a/src/lib/game/actions/voteAction.ts
+++ b/src/lib/game/actions/voteAction.ts
@@ -1,7 +1,7 @@
+import { ANSWER } from "$lib/game/services/actionService"
import type { Poll } from "../common"
import type { Player } from "../objects/units"
import { Action } from "./action"
-import { ANSWER } from "$lib/game/services/actionService";
interface IVoteActionOptions {
poll: Poll
diff --git a/src/lib/game/chunks/forest.ts b/src/lib/game/chunks/forest.ts
index e3df1007..74571e08 100644
--- a/src/lib/game/chunks/forest.ts
+++ b/src/lib/game/chunks/forest.ts
@@ -1,8 +1,8 @@
-import { type IGameChunkTheme, type IGameForestChunk, } from "$lib/game/types"
+import type { IGameChunkTheme, IGameForestChunk } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Stone, Tree } from "../objects"
import type { GameScene } from "../scenes/gameScene.ts"
import { GameChunk } from "./gameChunk"
-import { getRandomInRange } from "$lib/random";
interface IForestOptions {
center: IGameForestChunk["center"]
diff --git a/src/lib/game/chunks/gameChunk.ts b/src/lib/game/chunks/gameChunk.ts
index 7eed3ad3..8206e66c 100644
--- a/src/lib/game/chunks/gameChunk.ts
+++ b/src/lib/game/chunks/gameChunk.ts
@@ -1,8 +1,8 @@
+import type { IGameChunk, IGameChunkTheme } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { createId } from "@paralleldrive/cuid2"
-import { type IGameChunk, type IGameChunkTheme, } from "$lib/game/types"
import { Area, type GameObject, Tree } from "../objects"
import type { GameScene } from "../scenes/gameScene.ts"
-import { getRandomInRange } from "$lib/random";
interface IGameChunkOptions {
center: IGameChunk["center"]
@@ -25,14 +25,14 @@ export class GameChunk implements IGameChunk {
public objects: GameObject[] = []
constructor({
- title,
- type,
- theme,
- width,
- height,
- center,
- scene,
- }: IGameChunkOptions) {
+ title,
+ type,
+ theme,
+ width,
+ height,
+ center,
+ scene,
+ }: IGameChunkOptions) {
this.id = createId()
this.center = center
this.title = title
@@ -43,14 +43,13 @@ export class GameChunk implements IGameChunk {
this.initArea({ width, height, theme })
}
- public live() {
- }
+ public live() {}
private initArea({
- width,
- height,
- theme,
- }: {
+ width,
+ height,
+ theme,
+ }: {
width: number
height: number
theme: IGameChunkTheme
diff --git a/src/lib/game/chunks/lake.ts b/src/lib/game/chunks/lake.ts
index bcf19487..29f38ba3 100644
--- a/src/lib/game/chunks/lake.ts
+++ b/src/lib/game/chunks/lake.ts
@@ -1,8 +1,8 @@
-import { type IGameChunkTheme, type IGameLakeChunk, } from "$lib/game/types"
+import type { IGameChunkTheme, IGameLakeChunk } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Lake, Stone, Tree } from "../objects"
+import type { GameScene } from "../scenes/gameScene.ts"
import { GameChunk } from "./gameChunk"
-import type { GameScene } from "../scenes/gameScene.ts";
-import { getRandomInRange } from "$lib/random";
interface ILakeOptions {
scene: GameScene
@@ -44,12 +44,12 @@ export class LakeChunk extends GameChunk implements IGameLakeChunk {
const lake = new Lake({
scene: this.scene,
x: this.center.x - 100,
- y: this.center.y + 400
+ y: this.center.y + 400,
})
const lake2 = new Lake({
scene: this.scene,
x: this.center.x - 600,
- y: this.center.y + 500
+ y: this.center.y + 500,
})
this.objects.push(lake, lake2)
}
@@ -78,7 +78,7 @@ export class LakeChunk extends GameChunk implements IGameLakeChunk {
scene: this.scene,
x: point.x,
y: point.y,
- resource: 1
+ resource: 1,
})
this.objects.push(stone)
}
diff --git a/src/lib/game/chunks/village.ts b/src/lib/game/chunks/village.ts
index 7aae0bca..258e6ef4 100644
--- a/src/lib/game/chunks/village.ts
+++ b/src/lib/game/chunks/village.ts
@@ -1,8 +1,9 @@
-import {
- type IGameChunkTheme,
- type IGameObjectFlag,
- type IGameVillageChunk,
+import type {
+ IGameChunkTheme,
+ IGameObjectFlag,
+ IGameVillageChunk,
} from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Flag, Stone, Tree } from "../objects"
import { Campfire } from "../objects/buildings/campfire"
import { ConstructionArea } from "../objects/buildings/constructionArea"
@@ -14,12 +15,9 @@ import type { GameScene } from "../scenes/gameScene"
import { BuildScript } from "../scripts/buildScript"
import { ChopTreeScript } from "../scripts/chopTreeScript"
import { MoveToTargetScript } from "../scripts/moveToTargetScript"
-import {
- PlaceItemInWarehouseScript
-} from "../scripts/placeItemInWarehouseScript"
+import { PlaceItemInWarehouseScript } from "../scripts/placeItemInWarehouseScript"
import { PlantNewTreeScript } from "../scripts/plantNewTreeScript"
import { GameChunk } from "./gameChunk"
-import { getRandomInRange } from "$lib/random";
interface IVillageOptions {
scene: GameScene
diff --git a/src/lib/game/common/event.ts b/src/lib/game/common/event.ts
index 54502015..0792b838 100644
--- a/src/lib/game/common/event.ts
+++ b/src/lib/game/common/event.ts
@@ -1,6 +1,6 @@
+import { getDatePlusSeconds } from "$lib/date"
+import type { GameSceneType, IGameEvent } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
-import { type GameSceneType, type IGameEvent, } from "$lib/game/types"
-import { getDatePlusSeconds } from "$lib/date";
interface IEventOptions {
title: IGameEvent["title"]
@@ -27,15 +27,15 @@ export class Event implements IGameEvent {
public offers?: IGameEvent["offers"]
constructor({
- title,
- description,
- type,
- secondsToEnd,
- scene,
- poll,
- quest,
- offers,
- }: IEventOptions) {
+ title,
+ description,
+ type,
+ secondsToEnd,
+ scene,
+ poll,
+ quest,
+ offers,
+ }: IEventOptions) {
this.id = createId()
this.title = title
this.description = description
diff --git a/src/lib/game/common/generators/unitTop.ts b/src/lib/game/common/generators/unitTop.ts
index eae16907..13ef719f 100644
--- a/src/lib/game/common/generators/unitTop.ts
+++ b/src/lib/game/common/generators/unitTop.ts
@@ -11,5 +11,5 @@ export const generateUnitTop = (): Partial<
return availableTopsForUnits[
Math.floor(Math.random() * availableTopsForUnits.length)
- ]
+ ]
}
diff --git a/src/lib/game/common/group.ts b/src/lib/game/common/group.ts
index c6b447b5..34fbb259 100644
--- a/src/lib/game/common/group.ts
+++ b/src/lib/game/common/group.ts
@@ -1,5 +1,5 @@
+import type { IGameGroup, IGameObjectPlayer } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
-import type { IGameGroup, IGameObjectPlayer, } from "$lib/game/types"
import type { Player } from "../objects/units"
export class Group implements IGameGroup {
diff --git a/src/lib/game/common/inventory.ts b/src/lib/game/common/inventory.ts
index 6aa7b178..53b06237 100644
--- a/src/lib/game/common/inventory.ts
+++ b/src/lib/game/common/inventory.ts
@@ -1,9 +1,9 @@
-import { createId } from "@paralleldrive/cuid2"
import type {
IGameInventory,
IGameInventoryItem,
ItemType,
} from "$lib/game/types"
+import { createId } from "@paralleldrive/cuid2"
interface IInventoryOptions {
objectId: string
diff --git a/src/lib/game/common/poll.ts b/src/lib/game/common/poll.ts
index 73d2d724..acd701d4 100644
--- a/src/lib/game/common/poll.ts
+++ b/src/lib/game/common/poll.ts
@@ -1,8 +1,8 @@
+import type { IGameObjectPlayer, IGamePoll } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { createId } from "@paralleldrive/cuid2"
-import { type IGameObjectPlayer, type IGamePoll, } from "$lib/game/types"
import { VoteAction } from "../actions/voteAction"
import type { GameScene } from "../scenes/gameScene"
-import { getRandomInRange } from "$lib/random";
interface IPollOptions {
scene: GameScene
diff --git a/src/lib/game/common/route.ts b/src/lib/game/common/route.ts
index 8d7a278f..11e1cd7a 100644
--- a/src/lib/game/common/route.ts
+++ b/src/lib/game/common/route.ts
@@ -1,4 +1,4 @@
-import type { IGameChunk, IGameRoute, } from "$lib/game/types"
+import type { IGameChunk, IGameRoute } from "$lib/game/types"
import { Flag } from "../objects"
import type { GameScene } from "../scenes/gameScene"
diff --git a/src/lib/game/components/buildingInterface.ts b/src/lib/game/components/buildingInterface.ts
index 3c25c1e7..f25576dd 100644
--- a/src/lib/game/components/buildingInterface.ts
+++ b/src/lib/game/components/buildingInterface.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectBuilding } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
export class BuildingInterface extends GraphicsContainer {
diff --git a/src/lib/game/components/dialogueInterface.ts b/src/lib/game/components/dialogueInterface.ts
index ce552623..876075fb 100644
--- a/src/lib/game/components/dialogueInterface.ts
+++ b/src/lib/game/components/dialogueInterface.ts
@@ -1,5 +1,5 @@
-import { type Container, Graphics, Text } from "pixi.js"
import type { IGameObjectUnit } from "$lib/game/types"
+import { type Container, Graphics, Text } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
export class DialogueInterface extends GraphicsContainer {
diff --git a/src/lib/game/components/fireParticlesContainer.ts b/src/lib/game/components/fireParticlesContainer.ts
index 6223d125..d8cfb45c 100644
--- a/src/lib/game/components/fireParticlesContainer.ts
+++ b/src/lib/game/components/fireParticlesContainer.ts
@@ -1,6 +1,6 @@
+import { getRandomInRange } from "$lib/random"
import { Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
-import { getRandomInRange } from "$lib/random";
interface IFireParticlesContainerOptions {
x: number
diff --git a/src/lib/game/components/graphicsContainer.ts b/src/lib/game/components/graphicsContainer.ts
index e4bf3da0..49445893 100644
--- a/src/lib/game/components/graphicsContainer.ts
+++ b/src/lib/game/components/graphicsContainer.ts
@@ -1,8 +1,8 @@
-import { Container, Sprite } from "pixi.js"
import type {
GraphicsContainerType,
IGameObjectDirection,
} from "$lib/game/types"
+import { Container, Sprite } from "pixi.js"
interface IGraphicsContainerOptions {
type: GraphicsContainerType
diff --git a/src/lib/game/components/unitHairContainer.ts b/src/lib/game/components/unitHairContainer.ts
index 33f8f998..2f902810 100644
--- a/src/lib/game/components/unitHairContainer.ts
+++ b/src/lib/game/components/unitHairContainer.ts
@@ -1,5 +1,5 @@
+import type { IGameObjectDirection, IGameObjectUnit } from "$lib/game/types"
import { Sprite } from "pixi.js"
-import type { IGameObjectDirection, IGameObjectUnit, } from "$lib/game/types"
import { GraphicsContainer } from "./graphicsContainer"
interface IUnitHairContainerOptions {
diff --git a/src/lib/game/components/unitHeadContainer.ts b/src/lib/game/components/unitHeadContainer.ts
index e75b7990..e8748f7d 100644
--- a/src/lib/game/components/unitHeadContainer.ts
+++ b/src/lib/game/components/unitHeadContainer.ts
@@ -1,5 +1,5 @@
+import type { IGameObjectDirection, IGameObjectUnit } from "$lib/game/types"
import { Sprite } from "pixi.js"
-import type { IGameObjectDirection, IGameObjectUnit, } from "$lib/game/types"
import { GraphicsContainer } from "./graphicsContainer"
interface IUnitHeadContainerOptions {
diff --git a/src/lib/game/components/unitInterface.ts b/src/lib/game/components/unitInterface.ts
index e2d58059..34a8cca4 100644
--- a/src/lib/game/components/unitInterface.ts
+++ b/src/lib/game/components/unitInterface.ts
@@ -1,5 +1,5 @@
-import { Graphics, Sprite, Text } from "pixi.js"
import type { IGameObjectUnit } from "$lib/game/types"
+import { Graphics, Sprite, Text } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
export class UnitInterface extends GraphicsContainer {
diff --git a/src/lib/game/components/unitTopContainer.ts b/src/lib/game/components/unitTopContainer.ts
index c9faa554..964d2425 100644
--- a/src/lib/game/components/unitTopContainer.ts
+++ b/src/lib/game/components/unitTopContainer.ts
@@ -1,5 +1,5 @@
+import type { IGameObjectDirection, IGameObjectUnit } from "$lib/game/types"
import { Sprite } from "pixi.js"
-import type { IGameObjectDirection, IGameObjectUnit, } from "$lib/game/types"
import { GraphicsContainer } from "./graphicsContainer"
interface IUnitTopContainerOptions {
diff --git a/src/lib/game/components/wagonEngineCloudsContainer.ts b/src/lib/game/components/wagonEngineCloudsContainer.ts
index 38e5309c..87d77b35 100644
--- a/src/lib/game/components/wagonEngineCloudsContainer.ts
+++ b/src/lib/game/components/wagonEngineCloudsContainer.ts
@@ -1,7 +1,7 @@
+import type { Wagon } from "$lib/game/objects"
+import { getRandomInRange } from "$lib/random"
import { type Container, Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
-import { getRandomInRange } from "$lib/random";
-import { Wagon } from "$lib/game/objects";
interface IWagonEngineCloudsContainerOptions {
wagon: Wagon
diff --git a/src/lib/game/components/wagonEngineContainer.ts b/src/lib/game/components/wagonEngineContainer.ts
index 20bebea9..07e5856c 100644
--- a/src/lib/game/components/wagonEngineContainer.ts
+++ b/src/lib/game/components/wagonEngineContainer.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectDirection } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
interface IWagonEngineContainerOptions {
diff --git a/src/lib/game/components/wagonFuelContainer.ts b/src/lib/game/components/wagonFuelContainer.ts
index 125ae9a7..bfafc86c 100644
--- a/src/lib/game/components/wagonFuelContainer.ts
+++ b/src/lib/game/components/wagonFuelContainer.ts
@@ -1,6 +1,6 @@
+import { getRandomInRange } from "$lib/random"
import { Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
-import { getRandomInRange } from "$lib/random";
export class WagonFuelContainer extends GraphicsContainer {
constructor() {
diff --git a/src/lib/game/components/wagonWheelContainer.ts b/src/lib/game/components/wagonWheelContainer.ts
index 3111c96a..2e8ca232 100644
--- a/src/lib/game/components/wagonWheelContainer.ts
+++ b/src/lib/game/components/wagonWheelContainer.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectDirection } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import { GraphicsContainer } from "./graphicsContainer"
interface IWagonWheelContainerOptions {
diff --git a/src/lib/game/game.ts b/src/lib/game/game.ts
index 7b1b785b..fc79edbe 100644
--- a/src/lib/game/game.ts
+++ b/src/lib/game/game.ts
@@ -1,12 +1,12 @@
-import { Application, Container } from "pixi.js"
import type {
+ GameSceneType,
IGameObject,
IGameObjectPlayer,
IGameObjectTrader,
WebSocketMessage,
- GameSceneType,
} from "$lib/game/types"
-import { type GameObject, type Wagon } from "./objects"
+import { Application, Container } from "pixi.js"
+import type { GameObject, Wagon } from "./objects"
import { Player, Trader } from "./objects/units"
import type { GameScene } from "./scenes/gameScene"
import { MovingScene } from "./scenes/movingScene"
@@ -77,7 +77,7 @@ export class Game extends Container {
}
public async play() {
- this.audio.isEnabled = true;
+ this.audio.isEnabled = true
// setInterval(() => {
// console.log("FPS", this.app.ticker.FPS)
@@ -89,7 +89,7 @@ export class Game extends Container {
this.audio.destroy()
this.app.destroy()
- super.destroy();
+ super.destroy()
}
private changeCameraPosition(wagon: Wagon) {
diff --git a/src/lib/game/objects/buildings/building.ts b/src/lib/game/objects/buildings/building.ts
index bb537cc9..c9b8790a 100644
--- a/src/lib/game/objects/buildings/building.ts
+++ b/src/lib/game/objects/buildings/building.ts
@@ -1,5 +1,5 @@
+import type { IGameObjectBuilding, ItemType } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
-import type { IGameObjectBuilding, ItemType, } from "$lib/game/types"
import { Inventory } from "../../common"
import type { GameScene } from "../../scenes/gameScene"
import { GameObject } from "../gameObject"
diff --git a/src/lib/game/objects/buildings/campfire.ts b/src/lib/game/objects/buildings/campfire.ts
index 188c03e8..301f5adc 100644
--- a/src/lib/game/objects/buildings/campfire.ts
+++ b/src/lib/game/objects/buildings/campfire.ts
@@ -1,5 +1,5 @@
-import { type AnimatedSprite, Sprite } from "pixi.js"
import type { IGameBuildingCampfire } from "$lib/game/types"
+import { type AnimatedSprite, Sprite } from "pixi.js"
import { FireParticlesContainer } from "../../components/fireParticlesContainer"
import type { GameScene } from "../../scenes/gameScene.ts"
import { AssetsManager } from "../../utils"
diff --git a/src/lib/game/objects/buildings/constructionArea.ts b/src/lib/game/objects/buildings/constructionArea.ts
index e6f37b2e..9debcfe5 100644
--- a/src/lib/game/objects/buildings/constructionArea.ts
+++ b/src/lib/game/objects/buildings/constructionArea.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameBuildingConstructionArea } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { GameScene } from "../../scenes/gameScene"
import { Building } from "./building"
@@ -11,7 +11,8 @@ interface IConstructionAreaOptions {
export class ConstructionArea
extends Building
- implements IGameBuildingConstructionArea {
+ implements IGameBuildingConstructionArea
+{
constructor({ scene, x, y }: IConstructionAreaOptions) {
super({ scene, x, y })
diff --git a/src/lib/game/objects/buildings/store.ts b/src/lib/game/objects/buildings/store.ts
index 851e771c..c65634c7 100644
--- a/src/lib/game/objects/buildings/store.ts
+++ b/src/lib/game/objects/buildings/store.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameBuildingStore } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { GameScene } from "../../scenes/gameScene.ts"
import { Building } from "./building"
diff --git a/src/lib/game/objects/buildings/wagonStop.ts b/src/lib/game/objects/buildings/wagonStop.ts
index 4a0cf9f9..f91825f5 100644
--- a/src/lib/game/objects/buildings/wagonStop.ts
+++ b/src/lib/game/objects/buildings/wagonStop.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameBuildingWagonStop } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { GameScene } from "../../scenes/gameScene.ts"
import { Building } from "./building"
diff --git a/src/lib/game/objects/buildings/warehouse.ts b/src/lib/game/objects/buildings/warehouse.ts
index ae05468e..6e4c2545 100644
--- a/src/lib/game/objects/buildings/warehouse.ts
+++ b/src/lib/game/objects/buildings/warehouse.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameBuildingWarehouse } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import { BuildingInterface } from "../../components/buildingInterface"
import type { GameScene } from "../../scenes/gameScene.ts"
import { Building } from "./building"
diff --git a/src/lib/game/objects/flag.ts b/src/lib/game/objects/flag.ts
index 4f5c539f..9dbb92aa 100644
--- a/src/lib/game/objects/flag.ts
+++ b/src/lib/game/objects/flag.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectFlag } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { GameScene } from "../scenes/gameScene"
import { GameObject } from "./gameObject"
diff --git a/src/lib/game/objects/gameObject.ts b/src/lib/game/objects/gameObject.ts
index fbcb2de0..5ec7da48 100644
--- a/src/lib/game/objects/gameObject.ts
+++ b/src/lib/game/objects/gameObject.ts
@@ -1,6 +1,6 @@
+import type { IGameObject, IGameScript } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
import { Container } from "pixi.js"
-import type { IGameObject, IGameScript, } from "$lib/game/types"
import type { GameScene } from "../scenes/gameScene.ts"
interface IGameObjectOptions {
@@ -43,8 +43,7 @@ export class GameObject extends Container implements IGameObject {
this.zIndex = Math.round(this.y)
}
- live(): void {
- }
+ live(): void {}
public move() {
const isOnTarget = this.checkIfIsOnTarget()
diff --git a/src/lib/game/objects/lake.ts b/src/lib/game/objects/lake.ts
index 0e7a11bb..4391d6ab 100644
--- a/src/lib/game/objects/lake.ts
+++ b/src/lib/game/objects/lake.ts
@@ -1,8 +1,8 @@
import type { IGameObjectLake } from "$lib/game/types"
+import type { GameScene } from "../scenes/gameScene"
import { AssetsManager } from "../utils"
import { GameObject } from "./gameObject"
-import { GameScene } from "../scenes/gameScene";
-import { Water } from "./water";
+import { Water } from "./water"
interface ILakeOptions {
scene: GameScene
@@ -21,7 +21,7 @@ export class Lake extends GameObject implements IGameObjectLake {
}
public animate() {
- super.animate();
+ super.animate()
this.zIndex = 0
}
diff --git a/src/lib/game/objects/rabbit.ts b/src/lib/game/objects/rabbit.ts
index dc9c2617..ed20d2f6 100644
--- a/src/lib/game/objects/rabbit.ts
+++ b/src/lib/game/objects/rabbit.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectRabbit } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { Game } from "../game"
import { GameObject } from "./gameObject"
diff --git a/src/lib/game/objects/stone.ts b/src/lib/game/objects/stone.ts
index d0becc8f..b2d5f93f 100644
--- a/src/lib/game/objects/stone.ts
+++ b/src/lib/game/objects/stone.ts
@@ -1,8 +1,8 @@
+import type { IGameObjectStone } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Sprite } from "pixi.js"
-import { type IGameObjectStone } from "$lib/game/types"
import type { GameScene } from "../scenes/gameScene"
import { GameObject } from "./gameObject"
-import { getRandomInRange } from "$lib/random";
interface IStoneOptions {
scene: GameScene
diff --git a/src/lib/game/objects/tree.ts b/src/lib/game/objects/tree.ts
index f444c471..0af33f74 100644
--- a/src/lib/game/objects/tree.ts
+++ b/src/lib/game/objects/tree.ts
@@ -1,8 +1,8 @@
+import type { IGameObjectTree } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Sprite } from "pixi.js"
-import { type IGameObjectTree } from "$lib/game/types"
import type { GameScene } from "../scenes/gameScene"
import { GameObject } from "./gameObject"
-import { getRandomInRange } from "$lib/random";
interface ITreeOptions {
scene: GameScene
@@ -29,15 +29,15 @@ export class Tree extends GameObject implements IGameObjectTree {
private animationSpeedPerSecond = 3
constructor({
- scene,
- x,
- y,
- resource,
- size,
- health,
- type,
- variant,
- }: ITreeOptions) {
+ scene,
+ x,
+ y,
+ resource,
+ size,
+ health,
+ type,
+ variant,
+ }: ITreeOptions) {
super({ scene, x, y })
this.state = "IDLE"
@@ -129,12 +129,13 @@ export class Tree extends GameObject implements IGameObjectTree {
private shakeAnimation() {
if (Math.abs(this.angle) < 3) {
- this.angle += this.animationSpeedPerSecond * 5 / this.scene.game.tick
+ this.angle += (this.animationSpeedPerSecond * 5) / this.scene.game.tick
return
}
this.animationSpeedPerSecond *= -1
- this.angle += this.animationSpeedPerSecond * 5 / this.scene.game.tick * 10
+ this.angle +=
+ ((this.animationSpeedPerSecond * 5) / this.scene.game.tick) * 10
}
private shakeOnWind() {
@@ -144,7 +145,7 @@ export class Tree extends GameObject implements IGameObjectTree {
}
this.animationSpeedPerSecond *= -1
- this.angle += this.animationSpeedPerSecond / this.scene.game.tick * 10
+ this.angle += (this.animationSpeedPerSecond / this.scene.game.tick) * 10
}
private checkHealth() {
diff --git a/src/lib/game/objects/units/player.ts b/src/lib/game/objects/units/player.ts
index 7d626566..c76143f0 100644
--- a/src/lib/game/objects/units/player.ts
+++ b/src/lib/game/objects/units/player.ts
@@ -1,8 +1,8 @@
-import { type IGameObjectPlayer, type IGameSkill } from "$lib/game/types"
+import type { IGameObjectPlayer, IGameSkill } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Inventory, Skill } from "../../common"
import type { GameScene } from "../../scenes/gameScene.ts"
import { Unit } from "./unit"
-import { getRandomInRange } from "$lib/random";
interface IPlayerOptions {
scene: GameScene
diff --git a/src/lib/game/objects/units/unit.ts b/src/lib/game/objects/units/unit.ts
index 4e86805e..8f460829 100644
--- a/src/lib/game/objects/units/unit.ts
+++ b/src/lib/game/objects/units/unit.ts
@@ -1,6 +1,7 @@
+import type { IGameObjectUnit } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { createId } from "@paralleldrive/cuid2"
import type { AnimatedSprite } from "pixi.js"
-import { type IGameObjectUnit } from "$lib/game/types"
import { Inventory } from "../../common"
import { DialogueInterface } from "../../components/dialogueInterface"
import type { GraphicsContainer } from "../../components/graphicsContainer"
@@ -14,7 +15,6 @@ import { Flag } from "../flag"
import { GameObject } from "../gameObject"
import { Stone } from "../stone"
import { Tree } from "../tree"
-import { getRandomInRange } from "$lib/random";
interface IUnitOptions {
scene: GameScene
diff --git a/src/lib/game/objects/wagon.ts b/src/lib/game/objects/wagon.ts
index 5b9437b8..2c1950e7 100644
--- a/src/lib/game/objects/wagon.ts
+++ b/src/lib/game/objects/wagon.ts
@@ -1,12 +1,10 @@
+import type { IGameObjectWagon } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
import { Sprite } from "pixi.js"
-import type { IGameObjectWagon } from "$lib/game/types"
import { Inventory } from "../common"
import type { GraphicsContainer } from "../components/graphicsContainer"
import { WagonCargoContainer } from "../components/wagonCargoContainer"
-import {
- WagonEngineCloudsContainer
-} from "../components/wagonEngineCloudsContainer"
+import { WagonEngineCloudsContainer } from "../components/wagonEngineCloudsContainer"
import { WagonEngineContainer } from "../components/wagonEngineContainer"
import { WagonFuelBoxContainer } from "../components/wagonFuelBoxContainer"
import { WagonWheelContainer } from "../components/wagonWheelContainer"
diff --git a/src/lib/game/objects/water.ts b/src/lib/game/objects/water.ts
index c1d024d7..b270807b 100644
--- a/src/lib/game/objects/water.ts
+++ b/src/lib/game/objects/water.ts
@@ -1,6 +1,6 @@
import type { IGameObjectWater } from "$lib/game/types"
+import type { GameScene } from "../scenes/gameScene"
import { GameObject } from "./gameObject"
-import { GameScene } from "../scenes/gameScene";
interface IWaterOptions {
scene: GameScene
diff --git a/src/lib/game/objects/wolf.ts b/src/lib/game/objects/wolf.ts
index b8f71fef..3db692e7 100644
--- a/src/lib/game/objects/wolf.ts
+++ b/src/lib/game/objects/wolf.ts
@@ -1,5 +1,5 @@
-import { Sprite } from "pixi.js"
import type { IGameObjectWolf } from "$lib/game/types"
+import { Sprite } from "pixi.js"
import type { Game } from "../game"
import { GameObject } from "./gameObject"
diff --git a/src/lib/game/quests/noTradingPostQuest.ts b/src/lib/game/quests/noTradingPostQuest.ts
index f34b0d32..a881c470 100644
--- a/src/lib/game/quests/noTradingPostQuest.ts
+++ b/src/lib/game/quests/noTradingPostQuest.ts
@@ -1,8 +1,6 @@
-import { createId } from "@paralleldrive/cuid2"
import type { IGameQuestTaskFunc } from "$lib/game/types"
-import type {
- DonateWoodToVillageAction
-} from "../actions/donateWoodToVillageAction"
+import { createId } from "@paralleldrive/cuid2"
+import type { DonateWoodToVillageAction } from "../actions/donateWoodToVillageAction"
import { Quest } from "./quest"
interface INoTradingPostQuestOptions {
@@ -14,11 +12,11 @@ interface INoTradingPostQuestOptions {
export class NoTradingPostQuest extends Quest {
constructor({
- creatorId,
- taskUpdateFunc1,
- taskUpdateFunc2,
- taskAction1,
- }: INoTradingPostQuestOptions) {
+ creatorId,
+ taskUpdateFunc1,
+ taskUpdateFunc2,
+ taskAction1,
+ }: INoTradingPostQuestOptions) {
super({
type: "SIDE",
title: "No Trading Post",
@@ -30,10 +28,10 @@ export class NoTradingPostQuest extends Quest {
}
initTasks({
- taskUpdateFunc1,
- taskUpdateFunc2,
- taskAction1,
- }: {
+ taskUpdateFunc1,
+ taskUpdateFunc2,
+ taskAction1,
+ }: {
taskUpdateFunc1: IGameQuestTaskFunc
taskUpdateFunc2: IGameQuestTaskFunc
taskAction1: DonateWoodToVillageAction
diff --git a/src/lib/game/quests/quest.ts b/src/lib/game/quests/quest.ts
index eae1844b..4aff114d 100644
--- a/src/lib/game/quests/quest.ts
+++ b/src/lib/game/quests/quest.ts
@@ -1,5 +1,5 @@
-import { createId } from "@paralleldrive/cuid2"
import type { IGameQuest } from "$lib/game/types"
+import { createId } from "@paralleldrive/cuid2"
interface IQuestOptions {
type: IGameQuest["type"]
diff --git a/src/lib/game/quests/treesAreRunningOutQuest.ts b/src/lib/game/quests/treesAreRunningOutQuest.ts
index f61a1ade..d2eb28d9 100644
--- a/src/lib/game/quests/treesAreRunningOutQuest.ts
+++ b/src/lib/game/quests/treesAreRunningOutQuest.ts
@@ -1,5 +1,5 @@
-import { createId } from "@paralleldrive/cuid2"
import type { IGameQuestTaskFunc } from "$lib/game/types"
+import { createId } from "@paralleldrive/cuid2"
import type { PlantTreeAction } from "../actions/plantTreeAction"
import { Quest } from "./quest"
@@ -11,10 +11,10 @@ interface ITreesAreRunningOutQuestOptions {
export class TreesAreRunningOutQuest extends Quest {
constructor({
- creatorId,
- taskUpdateFunc1,
- taskAction1,
- }: ITreesAreRunningOutQuestOptions) {
+ creatorId,
+ taskUpdateFunc1,
+ taskAction1,
+ }: ITreesAreRunningOutQuestOptions) {
super({
type: "SIDE",
title: "The trees are running out!",
@@ -27,9 +27,9 @@ export class TreesAreRunningOutQuest extends Quest {
}
initTasks({
- taskUpdateFunc1,
- taskAction1,
- }: {
+ taskUpdateFunc1,
+ taskAction1,
+ }: {
taskUpdateFunc1: IGameQuestTaskFunc
taskAction1: PlantTreeAction
}) {
diff --git a/src/lib/game/scenes/gameScene.ts b/src/lib/game/scenes/gameScene.ts
index 8fcb40a8..94c5571b 100644
--- a/src/lib/game/scenes/gameScene.ts
+++ b/src/lib/game/scenes/gameScene.ts
@@ -1,10 +1,12 @@
-import { createId } from "@paralleldrive/cuid2"
-import {
- type GetSceneResponse,
- type IGameChunk,
- type IGameChunkTheme,
- type IGameInventoryItem,
+import { getDateMinusMinutes } from "$lib/date"
+import type {
+ GetSceneResponse,
+ IGameChunk,
+ IGameChunkTheme,
+ IGameInventoryItem,
} from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
+import { createId } from "@paralleldrive/cuid2"
import { type GameChunk, Village } from "../chunks"
import { Group, Route } from "../common"
import type { Game } from "../game"
@@ -18,16 +20,12 @@ import {
} from "../objects"
import { Player, Raider, Trader } from "../objects/units"
import { ChopTreeScript } from "../scripts/chopTreeScript"
-import {
- MoveOffScreenAndSelfDestroyScript
-} from "../scripts/moveOffScreenAndSelfDestroyScript"
+import { MoveOffScreenAndSelfDestroyScript } from "../scripts/moveOffScreenAndSelfDestroyScript"
import { MoveToTargetScript } from "../scripts/moveToTargetScript"
import { ActionService } from "../services/actionService"
import { EventService } from "../services/eventService"
import { TradeService } from "../services/tradeService"
import { WagonService } from "../services/wagonService"
-import { getRandomInRange } from "$lib/random";
-import { getDateMinusMinutes } from "$lib/date";
interface IGameSceneOptions {
game: Game
diff --git a/src/lib/game/scripts/buildScript.ts b/src/lib/game/scripts/buildScript.ts
index 2116167e..edc55ffe 100644
--- a/src/lib/game/scripts/buildScript.ts
+++ b/src/lib/game/scripts/buildScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
diff --git a/src/lib/game/scripts/chopTreeScript.ts b/src/lib/game/scripts/chopTreeScript.ts
index 117bc0af..b322f661 100644
--- a/src/lib/game/scripts/chopTreeScript.ts
+++ b/src/lib/game/scripts/chopTreeScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
diff --git a/src/lib/game/scripts/mineStoneScript.ts b/src/lib/game/scripts/mineStoneScript.ts
index 07c557ca..558548b2 100644
--- a/src/lib/game/scripts/mineStoneScript.ts
+++ b/src/lib/game/scripts/mineStoneScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
diff --git a/src/lib/game/scripts/moveOffScreenAndSelfDestroyScript.ts b/src/lib/game/scripts/moveOffScreenAndSelfDestroyScript.ts
index 36325e77..1806fb93 100644
--- a/src/lib/game/scripts/moveOffScreenAndSelfDestroyScript.ts
+++ b/src/lib/game/scripts/moveOffScreenAndSelfDestroyScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
@@ -10,10 +10,10 @@ interface IMoveOffScreenAndSelfDestroyScriptOptions {
export class MoveOffScreenAndSelfDestroyScript extends Script {
constructor({
- target,
- object,
- selfDestroyFunc,
- }: IMoveOffScreenAndSelfDestroyScriptOptions) {
+ target,
+ object,
+ selfDestroyFunc,
+ }: IMoveOffScreenAndSelfDestroyScriptOptions) {
super({ object })
this.tasks = [
diff --git a/src/lib/game/scripts/moveToTradePostAndTradeScript.ts b/src/lib/game/scripts/moveToTradePostAndTradeScript.ts
index f5bcb7d1..a6fa7e0b 100644
--- a/src/lib/game/scripts/moveToTradePostAndTradeScript.ts
+++ b/src/lib/game/scripts/moveToTradePostAndTradeScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
@@ -10,10 +10,10 @@ interface IMoveToTradePostAndTradeScriptOptions {
export class MoveToTradePostAndTradeScript extends Script {
constructor({
- target,
- object,
- startTradeFunc,
- }: IMoveToTradePostAndTradeScriptOptions) {
+ target,
+ object,
+ startTradeFunc,
+ }: IMoveToTradePostAndTradeScriptOptions) {
super({ object })
this.tasks = [
diff --git a/src/lib/game/scripts/placeItemInWarehouseScript.ts b/src/lib/game/scripts/placeItemInWarehouseScript.ts
index 9f7dd760..004857f1 100644
--- a/src/lib/game/scripts/placeItemInWarehouseScript.ts
+++ b/src/lib/game/scripts/placeItemInWarehouseScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
@@ -10,10 +10,10 @@ interface IPlaceItemInWarehouseScriptOptions {
export class PlaceItemInWarehouseScript extends Script {
constructor({
- target,
- object,
- placeItemFunc,
- }: IPlaceItemInWarehouseScriptOptions) {
+ target,
+ object,
+ placeItemFunc,
+ }: IPlaceItemInWarehouseScriptOptions) {
super({ object })
this.tasks = [
diff --git a/src/lib/game/scripts/plantNewTreeScript.ts b/src/lib/game/scripts/plantNewTreeScript.ts
index 254f0381..9acc457c 100644
--- a/src/lib/game/scripts/plantNewTreeScript.ts
+++ b/src/lib/game/scripts/plantNewTreeScript.ts
@@ -1,4 +1,4 @@
-import type { IGameObject, IGameTask, } from "$lib/game/types"
+import type { IGameObject, IGameTask } from "$lib/game/types"
import type { GameObject } from "../objects"
import { Script } from "./script"
@@ -10,10 +10,10 @@ interface IPlantNewTreeScriptOptions {
export class PlantNewTreeScript extends Script {
constructor({
- target,
- object,
- plantNewTreeFunc,
- }: IPlantNewTreeScriptOptions) {
+ target,
+ object,
+ plantNewTreeFunc,
+ }: IPlantNewTreeScriptOptions) {
super({ object })
this.tasks = [
diff --git a/src/lib/game/scripts/script.ts b/src/lib/game/scripts/script.ts
index f96a69fc..2e9ca24b 100644
--- a/src/lib/game/scripts/script.ts
+++ b/src/lib/game/scripts/script.ts
@@ -1,5 +1,5 @@
+import type { IGameObject, IGameScript, IGameTask } from "$lib/game/types"
import { createId } from "@paralleldrive/cuid2"
-import type { IGameObject, IGameScript, IGameTask, } from "$lib/game/types"
import type { GameObject } from "../objects"
interface IScriptOptions {
diff --git a/src/lib/game/services/actionService.ts b/src/lib/game/services/actionService.ts
index 53662206..ea15d1e9 100644
--- a/src/lib/game/services/actionService.ts
+++ b/src/lib/game/services/actionService.ts
@@ -1,3 +1,9 @@
+import {
+ ADMIN_PLAYER_ID,
+ DISCORD_SERVER_INVITE_URL,
+ DONATE_URL,
+ GITHUB_REPO_URL,
+} from "$lib/config"
import type {
GameSceneType,
IGameActionResponse,
@@ -14,12 +20,6 @@ import type { GameScene } from "../scenes/gameScene"
import { ChopTreeScript } from "../scripts/chopTreeScript"
import { MineStoneScript } from "../scripts/mineStoneScript"
import { PlantNewTreeScript } from "../scripts/plantNewTreeScript"
-import {
- ADMIN_PLAYER_ID,
- DISCORD_SERVER_INVITE_URL,
- GITHUB_REPO_URL,
- DONATE_URL
-} from "$lib/config";
interface ICommandWithAction {
id: string
diff --git a/src/lib/game/services/eventService.ts b/src/lib/game/services/eventService.ts
index 42eaaf76..e47f48c9 100644
--- a/src/lib/game/services/eventService.ts
+++ b/src/lib/game/services/eventService.ts
@@ -46,15 +46,15 @@ export class EventService {
}
public init({
- title,
- description,
- type,
- secondsToEnd,
- scene,
- poll,
- quest,
- offers,
- }: {
+ title,
+ description,
+ type,
+ secondsToEnd,
+ scene,
+ poll,
+ quest,
+ offers,
+ }: {
title: IGameEvent["title"]
description: IGameEvent["description"]
type: IGameEvent["type"]
@@ -100,10 +100,10 @@ export class EventService {
const tasks = quest?.tasks.map((t) => {
const action = t.action
? {
- ...t.action,
- live: undefined,
- scene: undefined,
- }
+ ...t.action,
+ live: undefined,
+ scene: undefined,
+ }
: undefined
return { ...t, action }
})
diff --git a/src/lib/game/services/pollService.ts b/src/lib/game/services/pollService.ts
index cbd1deb9..d21aeb3f 100644
--- a/src/lib/game/services/pollService.ts
+++ b/src/lib/game/services/pollService.ts
@@ -1,4 +1,4 @@
-import type { IGameObjectPlayer, IGamePoll, } from "$lib/game/types"
+import type { IGameObjectPlayer, IGamePoll } from "$lib/game/types"
import type { Player } from "../objects/units"
import type { GameScene } from "../scenes/gameScene"
diff --git a/src/lib/game/services/questService.ts b/src/lib/game/services/questService.ts
index 1a14e8bb..4528ec7c 100644
--- a/src/lib/game/services/questService.ts
+++ b/src/lib/game/services/questService.ts
@@ -1,9 +1,9 @@
-import { createId } from "@paralleldrive/cuid2"
import type {
IGameQuest,
IGameQuestTask,
IGameQuestTaskFunc,
} from "$lib/game/types"
+import { createId } from "@paralleldrive/cuid2"
import { DonateWoodToVillageAction } from "../actions/donateWoodToVillageAction"
import { PlantTreeAction } from "../actions/plantTreeAction"
import { Village } from "../chunks"
@@ -43,14 +43,14 @@ export class QuestService {
}
public create({
- status,
- type,
- tasks,
- conditions,
- creatorId,
- title,
- description,
- }: Omit
): IGameQuest {
+ status,
+ type,
+ tasks,
+ conditions,
+ creatorId,
+ title,
+ description,
+ }: Omit): IGameQuest {
return {
id: createId(),
status,
@@ -64,11 +64,11 @@ export class QuestService {
}
public createTask({
- updateProgress,
- progressToSuccess,
- progressNow,
- description,
- }: Pick<
+ updateProgress,
+ progressToSuccess,
+ progressNow,
+ description,
+ }: Pick<
IGameQuestTask,
"description" | "progressToSuccess" | "progressNow" | "updateProgress"
>): IGameQuestTask {
diff --git a/src/lib/game/services/routeService.ts b/src/lib/game/services/routeService.ts
index a81ded4a..e4de11f4 100644
--- a/src/lib/game/services/routeService.ts
+++ b/src/lib/game/services/routeService.ts
@@ -1,9 +1,9 @@
-import { type IGameChunkTheme, type IGameRoute, } from "$lib/game/types"
+import type { IGameChunkTheme, IGameRoute } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Forest, LakeChunk, Village } from "../chunks"
import { Route } from "../common"
import { Stone, Tree } from "../objects"
import type { GameScene } from "../scenes/gameScene"
-import { getRandomInRange } from "$lib/random";
interface IRouteServiceOptions {
scene: GameScene
@@ -138,12 +138,12 @@ export class RouteService {
}
generateRandomVillage({
- center,
- width,
- height,
- theme,
- scene,
- }: {
+ center,
+ width,
+ height,
+ theme,
+ scene,
+ }: {
center: { x: number; y: number }
width: number
height: number
@@ -154,11 +154,11 @@ export class RouteService {
}
generateRandomForest({
- center,
- width,
- height,
- theme,
- }: {
+ center,
+ width,
+ height,
+ theme,
+ }: {
center: { x: number; y: number }
width: number
height: number
@@ -169,18 +169,18 @@ export class RouteService {
width,
height,
center,
- theme
+ theme,
})
this.scene.chunks.push(forest)
return forest
}
generateRandomLake({
- center,
- width,
- height,
- theme,
- }: {
+ center,
+ width,
+ height,
+ theme,
+ }: {
center: { x: number; y: number }
width: number
height: number
@@ -191,7 +191,7 @@ export class RouteService {
width,
height,
center,
- theme
+ theme,
})
this.scene.chunks.push(lake)
return lake
diff --git a/src/lib/game/services/tradeService.ts b/src/lib/game/services/tradeService.ts
index 07654569..5005c5c3 100644
--- a/src/lib/game/services/tradeService.ts
+++ b/src/lib/game/services/tradeService.ts
@@ -1,18 +1,14 @@
-import { type ITradeOffer } from "$lib/game/types"
+import type { ITradeOffer } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Village } from "../chunks"
import { Poll } from "../common"
import { Flag } from "../objects"
import type { Player } from "../objects/units"
import { Trader } from "../objects/units"
import type { GameScene } from "../scenes/gameScene"
-import {
- MoveOffScreenAndSelfDestroyScript
-} from "../scripts/moveOffScreenAndSelfDestroyScript"
+import { MoveOffScreenAndSelfDestroyScript } from "../scripts/moveOffScreenAndSelfDestroyScript"
import { MoveToTargetScript } from "../scripts/moveToTargetScript"
-import {
- MoveToTradePostAndTradeScript
-} from "../scripts/moveToTradePostAndTradeScript"
-import { getRandomInRange } from "$lib/random";
+import { MoveToTradePostAndTradeScript } from "../scripts/moveToTradePostAndTradeScript"
interface ITradeServiceOptions {
scene: GameScene
diff --git a/src/lib/game/services/wagonService.ts b/src/lib/game/services/wagonService.ts
index cf6addc0..ba21f14c 100644
--- a/src/lib/game/services/wagonService.ts
+++ b/src/lib/game/services/wagonService.ts
@@ -1,7 +1,7 @@
+import { getMinusOrPlus, getRandomInRange } from "$lib/random"
import { Flag, Wagon } from "../objects"
import type { GameScene } from "../scenes/gameScene"
import { RouteService } from "./routeService"
-import { getRandomInRange, getMinusOrPlus } from "$lib/random";
interface IWagonServiceOptions {
scene: GameScene
diff --git a/src/lib/game/utils/assetsManager.ts b/src/lib/game/utils/assetsManager.ts
index 0113d46c..3eeff631 100644
--- a/src/lib/game/utils/assetsManager.ts
+++ b/src/lib/game/utils/assetsManager.ts
@@ -1,48 +1,29 @@
-import {
- AnimatedSprite,
- type Application,
- Assets,
- Graphics,
- Sprite,
- Texture,
- TilingSprite,
-} from "pixi.js"
-import { type IGameObjectUnit } from "$lib/game/types"
-import campfireAnimation1
- from "$lib/assets/game/images/animation/campfire/1.png"
-import campfireAnimation2
- from "$lib/assets/game/images/animation/campfire/2.png"
-import campfireAnimation3
- from "$lib/assets/game/images/animation/campfire/3.png"
-import campfireAnimation4
- from "$lib/assets/game/images/animation/campfire/4.png"
-import campfireAnimation5
- from "$lib/assets/game/images/animation/campfire/5.png"
-import fireParticle1
- from "$lib/assets/game/images/animation/campfire/particle-1.png"
-import fireParticle2
- from "$lib/assets/game/images/animation/campfire/particle-2.png"
-import fireParticle3
- from "$lib/assets/game/images/animation/campfire/particle-3.png"
-import heroRight1
- from "$lib/assets/game/images/animation/hero-moving-right/1.png"
-import heroRight2
- from "$lib/assets/game/images/animation/hero-moving-right/2.png"
-import heroRight3
- from "$lib/assets/game/images/animation/hero-moving-right/3.png"
-import heroRight4
- from "$lib/assets/game/images/animation/hero-moving-right/4.png"
-import heroRight5
- from "$lib/assets/game/images/animation/hero-moving-right/5.png"
-import heroRight6
- from "$lib/assets/game/images/animation/hero-moving-right/6.png"
+import campfireAnimation1 from "$lib/assets/game/images/animation/campfire/1.png"
+import campfireAnimation2 from "$lib/assets/game/images/animation/campfire/2.png"
+import campfireAnimation3 from "$lib/assets/game/images/animation/campfire/3.png"
+import campfireAnimation4 from "$lib/assets/game/images/animation/campfire/4.png"
+import campfireAnimation5 from "$lib/assets/game/images/animation/campfire/5.png"
+import fireParticle1 from "$lib/assets/game/images/animation/campfire/particle-1.png"
+import fireParticle2 from "$lib/assets/game/images/animation/campfire/particle-2.png"
+import fireParticle3 from "$lib/assets/game/images/animation/campfire/particle-3.png"
+import heroRight1 from "$lib/assets/game/images/animation/hero-moving-right/1.png"
+import heroRight2 from "$lib/assets/game/images/animation/hero-moving-right/2.png"
+import heroRight3 from "$lib/assets/game/images/animation/hero-moving-right/3.png"
+import heroRight4 from "$lib/assets/game/images/animation/hero-moving-right/4.png"
+import heroRight5 from "$lib/assets/game/images/animation/hero-moving-right/5.png"
+import heroRight6 from "$lib/assets/game/images/animation/hero-moving-right/6.png"
import campfire1 from "$lib/assets/game/images/buildings/camp-fire-1.png"
-import constructionArea1
- from "$lib/assets/game/images/buildings/construction-1.png"
+import constructionArea1 from "$lib/assets/game/images/buildings/construction-1.png"
import store1 from "$lib/assets/game/images/buildings/store.png"
import wagonStop1 from "$lib/assets/game/images/buildings/wagon-stop-1.png"
import warehouse1 from "$lib/assets/game/images/buildings/warehouse-1.png"
+import rabbitLeft from "$lib/assets/game/images/creatures/rabbit1_left_64.png"
+import rabbitRight from "$lib/assets/game/images/creatures/rabbit1_right_64.png"
+import wolfLeft from "$lib/assets/game/images/creatures/wolf1_left_64.png"
+import wolfRight from "$lib/assets/game/images/creatures/wolf1_right_64.png"
import coin1 from "$lib/assets/game/images/icons/coin-1.png"
+import stoneRes1 from "$lib/assets/game/images/icons/items/stone.png"
+import wood1 from "$lib/assets/game/images/icons/items/wood.png"
import flag1 from "$lib/assets/game/images/objects/flag-1.png"
import flag2 from "$lib/assets/game/images/objects/flag-2.png"
import stone1 from "$lib/assets/game/images/objects/stone-1.png"
@@ -76,20 +57,17 @@ import tree5Stone from "$lib/assets/game/images/objects/tree/5/stone.png"
import tree5Teal from "$lib/assets/game/images/objects/tree/5/teal.png"
import tree5Toxic from "$lib/assets/game/images/objects/tree/5/toxic.png"
import tree5Violet from "$lib/assets/game/images/objects/tree/5/violet.png"
-import unitHairClassicRight
- from "$lib/assets/game/images/unit/hairstyle/hair-classic-right.png"
-import unitHairCoalLongRight
- from "$lib/assets/game/images/unit/hairstyle/hair-coal-long-right.png"
-import unitHairOrangeWithBeard
- from "$lib/assets/game/images/unit/hairstyle/orange-with-beard.png"
+import toolAxe1 from "$lib/assets/game/images/tools/axe1_64.png"
+import toolPickaxe1 from "$lib/assets/game/images/tools/pickaxe1_64.png"
+import unitHairClassicRight from "$lib/assets/game/images/unit/hairstyle/hair-classic-right.png"
+import unitHairCoalLongRight from "$lib/assets/game/images/unit/hairstyle/hair-coal-long-right.png"
+import unitHairOrangeWithBeard from "$lib/assets/game/images/unit/hairstyle/orange-with-beard.png"
import unitHead1Right from "$lib/assets/game/images/unit/head/head-1-right.png"
import blackTopRight from "$lib/assets/game/images/unit/top/black-top-right.png"
import blueTopRight from "$lib/assets/game/images/unit/top/blue-top-right.png"
-import darkSilverTopRight
- from "$lib/assets/game/images/unit/top/dark-silver-top-right.png"
+import darkSilverTopRight from "$lib/assets/game/images/unit/top/dark-silver-top-right.png"
import greenTopRight from "$lib/assets/game/images/unit/top/green-top-right.png"
-import violetTopRight
- from "$lib/assets/game/images/unit/top/violet-top-right.png"
+import violetTopRight from "$lib/assets/game/images/unit/top/violet-top-right.png"
import chest1 from "$lib/assets/game/images/wagon/chest-1.png"
import wagonEngineCloud1 from "$lib/assets/game/images/wagon/clouds/1.png"
import wagonEngineCloud2 from "$lib/assets/game/images/wagon/clouds/2.png"
@@ -98,8 +76,7 @@ import wagonEngineCloud4 from "$lib/assets/game/images/wagon/clouds/4.png"
import wagonEngine1 from "$lib/assets/game/images/wagon/engine-1.png"
import wagonFuel1 from "$lib/assets/game/images/wagon/fuel-1.png"
import wagonFuel2 from "$lib/assets/game/images/wagon/fuel-2.png"
-import wagonFuelContainer1
- from "$lib/assets/game/images/wagon/fuel-container.png"
+import wagonFuelContainer1 from "$lib/assets/game/images/wagon/fuel-container.png"
import wagonBase1 from "$lib/assets/game/images/wagon/wagon-1.png"
import wagonBase2 from "$lib/assets/game/images/wagon/wagon-2.png"
import wagonWheel1 from "$lib/assets/game/images/wagon/wheel-1.png"
@@ -107,15 +84,17 @@ import water1 from "$lib/assets/game/images/water/1.png"
import water2 from "$lib/assets/game/images/water/2.png"
import water3 from "$lib/assets/game/images/water/3.png"
import water4 from "$lib/assets/game/images/water/4.png"
-import wood1 from "$lib/assets/game/images/icons/items/wood.png"
-import stoneRes1 from "$lib/assets/game/images/icons/items/stone.png"
-import toolAxe1 from "$lib/assets/game/images/tools/axe1_64.png"
-import toolPickaxe1 from "$lib/assets/game/images/tools/pickaxe1_64.png"
-import rabbitLeft from "$lib/assets/game/images/creatures/rabbit1_left_64.png"
-import rabbitRight from "$lib/assets/game/images/creatures/rabbit1_right_64.png"
-import wolfLeft from "$lib/assets/game/images/creatures/wolf1_left_64.png"
-import wolfRight from "$lib/assets/game/images/creatures/wolf1_right_64.png"
-import { getRandomInRange } from "$lib/random";
+import type { IGameObjectUnit } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
+import {
+ AnimatedSprite,
+ type Application,
+ Assets,
+ Graphics,
+ Sprite,
+ Texture,
+ TilingSprite,
+} from "pixi.js"
export abstract class AssetsManager {
static assets = [
@@ -369,10 +348,10 @@ export abstract class AssetsManager {
}
public static generateRandomGridBackground({
- app,
- width,
- height,
- }: {
+ app,
+ width,
+ height,
+ }: {
app: Application
width: number
height: number
diff --git a/src/lib/game/utils/audioManager.ts b/src/lib/game/utils/audioManager.ts
index 0deed245..56c72194 100644
--- a/src/lib/game/utils/audioManager.ts
+++ b/src/lib/game/utils/audioManager.ts
@@ -1,13 +1,12 @@
-import { Howl } from "howler"
import chop1Audio from "$lib/assets/game/audio/chop-1.wav"
import fireBurn1Audio from "$lib/assets/game/audio/fire-1.wav"
import forest1Audio from "$lib/assets/game/audio/forest-1.mp3"
import handPunch1Audio from "$lib/assets/game/audio/hand-punch-1.wav"
-import marchWithHorns1Audio
- from "$lib/assets/game/audio/marching-with-horns-1.wav"
+import marchWithHorns1Audio from "$lib/assets/game/audio/marching-with-horns-1.wav"
import mine1Audio from "$lib/assets/game/audio/mine-1.wav"
import wagon1Audio from "$lib/assets/game/audio/wagon-1.wav"
import yeah1Audio from "$lib/assets/game/audio/yeah-1.wav"
+import { Howl } from "howler"
type SoundName =
| "CHOP_HIT"
diff --git a/src/lib/game/utils/generators/background.ts b/src/lib/game/utils/generators/background.ts
index 4960c517..320a402c 100644
--- a/src/lib/game/utils/generators/background.ts
+++ b/src/lib/game/utils/generators/background.ts
@@ -1,5 +1,6 @@
+import type { IGameChunkTheme } from "$lib/game/types"
+import { getRandomInRange } from "$lib/random"
import { Application, Container, Graphics, Sprite, TilingSprite } from "pixi.js"
-import { type IGameChunkTheme } from "$lib/game/types"
import {
BACKGROUND_TILE_1,
BACKGROUND_TILE_2,
@@ -7,7 +8,6 @@ import {
BACKGROUND_TILE_4,
BACKGROUND_TILE_5,
} from "./backgroundImages"
-import { getRandomInRange } from "$lib/random";
interface Palette {
93: string
@@ -191,7 +191,7 @@ export class BackgroundGenerator {
(imageData?.data[redIndex] +
imageData?.data[greenIndex] +
imageData?.data[blueIndex]) /
- 3,
+ 3,
)
pixels.push(average)
@@ -226,9 +226,9 @@ export class BackgroundGenerator {
}
generateRandomGridBackground({
- width,
- height,
- }: {
+ width,
+ height,
+ }: {
width: number
height: number
}) {
diff --git a/src/lib/game/utils/messageController.ts b/src/lib/game/utils/messageController.ts
index f5116616..85f21dfc 100644
--- a/src/lib/game/utils/messageController.ts
+++ b/src/lib/game/utils/messageController.ts
@@ -1,4 +1,4 @@
-import type { WebSocketMessage } from "$lib/game/types";
+import type { WebSocketMessage } from "$lib/game/types"
export class MessageController {
public static parse(message: string): WebSocketMessage | undefined {
diff --git a/src/lib/game/utils/webSocketManager.ts b/src/lib/game/utils/webSocketManager.ts
index 9276ebe4..86de5a70 100644
--- a/src/lib/game/utils/webSocketManager.ts
+++ b/src/lib/game/utils/webSocketManager.ts
@@ -1,5 +1,5 @@
+import { MessageController } from "$lib/game/utils/messageController"
import type { Game } from "../game"
-import { MessageController } from "$lib/game/utils/messageController";
export abstract class WebSocketManager {
public static socket: WebSocket
diff --git a/src/lib/locale.ts b/src/lib/locale.ts
index eefc136c..982e7280 100644
--- a/src/lib/locale.ts
+++ b/src/lib/locale.ts
@@ -1,3 +1,10 @@
-export function ruWordWithEndings(int: number, array: [string, string, string]) {
- return array[(int % 100 > 4 && int % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(int % 10 < 5) ? int % 10 : 5]];
-}
\ No newline at end of file
+export function ruWordWithEndings(
+ int: number,
+ array: [string, string, string],
+) {
+ return array[
+ int % 100 > 4 && int % 100 < 20
+ ? 2
+ : [2, 0, 1, 1, 1, 2][int % 10 < 5 ? int % 10 : 5]
+ ]
+}
diff --git a/src/lib/server/db/db.repository.ts b/src/lib/server/db/db.repository.ts
index eeed007f..34132d36 100644
--- a/src/lib/server/db/db.repository.ts
+++ b/src/lib/server/db/db.repository.ts
@@ -143,11 +143,11 @@ export class DBRepository {
}
createPlayer({
- profileId,
- name,
- inventoryId,
- id,
- }: {
+ profileId,
+ name,
+ inventoryId,
+ id,
+ }: {
profileId: string
name: string
inventoryId: string
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 60c2208d..e71e08f6 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -3,4 +3,4 @@ export interface IProfile {
twitchToken: string
twitchId: string
userName: string
-}
\ No newline at end of file
+}
diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte
index 1dab7398..a55a9815 100644
--- a/src/routes/+error.svelte
+++ b/src/routes/+error.svelte
@@ -1,5 +1,5 @@
{$page.status}: {$page.error?.message}
diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts
index c536b7d0..95ad281a 100644
--- a/src/routes/+layout.server.ts
+++ b/src/routes/+layout.server.ts
@@ -2,6 +2,6 @@ import type { LayoutServerLoad } from "./$types"
export const load = (async ({ locals }) => {
return {
- profile: locals.profile
+ profile: locals.profile,
}
-}) satisfies LayoutServerLoad
\ No newline at end of file
+}) satisfies LayoutServerLoad
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index b46993b7..0d5db439 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,7 +1,7 @@
diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts
index 0a7dc0eb..6ce3edea 100644
--- a/src/routes/+page.server.ts
+++ b/src/routes/+page.server.ts
@@ -1,11 +1,11 @@
-import type { PageServerLoad } from "./$types"
import { db } from "$lib/server/db/db.client"
+import type { PageServerLoad } from "./$types"
export const prerender = false
export const ssr = true
export const load = (async () => {
return {
- count: await db.profile.count()
+ count: await db.profile.count(),
}
}) satisfies PageServerLoad
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 0aff8619..d0faca63 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,43 +1,47 @@
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
index a0708964..19c1fe96 100644
--- a/src/routes/about/+page.svelte
+++ b/src/routes/about/+page.svelte
@@ -1,5 +1,5 @@
diff --git a/src/routes/auth/profile/+server.ts b/src/routes/auth/profile/+server.ts
index 82ea3558..6e7162ac 100644
--- a/src/routes/auth/profile/+server.ts
+++ b/src/routes/auth/profile/+server.ts
@@ -1,6 +1,6 @@
-import { json, error } from '@sveltejs/kit';
-import type { RequestHandler } from './$types';
-import { env } from '$env/dynamic/public';
+import { env } from "$env/dynamic/public"
+import { error, json } from "@sveltejs/kit"
+import type { RequestHandler } from "./$types"
export const GET: RequestHandler = async ({ locals }) => {
if (!locals.profile) {
@@ -8,7 +8,7 @@ export const GET: RequestHandler = async ({ locals }) => {
}
return json(locals.profile)
-};
+}
export const DELETE: RequestHandler = async ({ cookies }) => {
const cookieKey = env.PUBLIC_COOKIE_KEY
@@ -21,6 +21,6 @@ export const DELETE: RequestHandler = async ({ cookies }) => {
}
return json({
- ok: true
+ ok: true,
})
-};
+}
diff --git a/src/routes/auth/sign-in/+page.svelte b/src/routes/auth/sign-in/+page.svelte
index ac676203..46876718 100644
--- a/src/routes/auth/sign-in/+page.svelte
+++ b/src/routes/auth/sign-in/+page.svelte
@@ -1,16 +1,16 @@
diff --git a/src/routes/auth/sign-in/+server.ts b/src/routes/auth/sign-in/+server.ts
index 2e872e58..b0c20fd5 100644
--- a/src/routes/auth/sign-in/+server.ts
+++ b/src/routes/auth/sign-in/+server.ts
@@ -1,20 +1,23 @@
-import { json, error } from '@sveltejs/kit';
-import type { RequestHandler } from './$types';
-import { env as publicEnv } from '$env/dynamic/public';
-import jwt from "jsonwebtoken";
-import type { IProfile } from "$lib/types";
-import { env as privateEnv } from '$env/dynamic/private';
-import { StaticAuthProvider, getTokenInfo } from "@twurple/auth";
-import { ApiClient } from "@twurple/api";
-import { db } from "$lib/server/db/db.client";
-import { createId } from "@paralleldrive/cuid2";
+import { env as privateEnv } from "$env/dynamic/private"
+import { env as publicEnv } from "$env/dynamic/public"
+import { db } from "$lib/server/db/db.client"
+import type { IProfile } from "$lib/types"
+import { createId } from "@paralleldrive/cuid2"
+import { error, json } from "@sveltejs/kit"
+import { ApiClient } from "@twurple/api"
+import { StaticAuthProvider, getTokenInfo } from "@twurple/auth"
+import jwt from "jsonwebtoken"
+import type { RequestHandler } from "./$types"
-const findOrCreateProfile = async ({ twitchId, userName }: {
- twitchId: string,
+const findOrCreateProfile = async ({
+ twitchId,
+ userName,
+}: {
+ twitchId: string
userName: string
}) => {
const profileInDB = await db.profile.findFirst({
- where: { twitchId }
+ where: { twitchId },
})
if (!profileInDB) {
return db.profile.create({
@@ -22,7 +25,7 @@ const findOrCreateProfile = async ({ twitchId, userName }: {
id: createId(),
twitchId,
userName,
- }
+ },
})
}
@@ -45,8 +48,8 @@ const prepareJwtToken = async (accessToken: string) => {
error(400, "Wrong userId")
}
- const authProvider = new StaticAuthProvider(clientId, accessToken);
- const apiClient = new ApiClient({ authProvider });
+ const authProvider = new StaticAuthProvider(clientId, accessToken)
+ const apiClient = new ApiClient({ authProvider })
const user = await apiClient.users.getUserById(tokenInfo.userId)
if (!user) {
error(400, "Wrong user data")
@@ -54,17 +57,17 @@ const prepareJwtToken = async (accessToken: string) => {
const profileInDB = await findOrCreateProfile({
twitchId: user.id,
- userName: user.name
+ userName: user.name,
})
const profile: IProfile = {
id: profileInDB.id,
twitchToken: accessToken,
twitchId: user.id,
- userName: user.name
+ userName: user.name,
}
- return jwt.sign({ profile }, jwtSecret, { expiresIn: '24h' })
+ return jwt.sign({ profile }, jwtSecret, { expiresIn: "24h" })
}
export const POST: RequestHandler = async ({ request, cookies }) => {
@@ -79,7 +82,7 @@ export const POST: RequestHandler = async ({ request, cookies }) => {
}
const justString = data.hash.split("#")[1]
- const items = new URLSearchParams(justString);
+ const items = new URLSearchParams(justString)
if (items.has("access_token")) {
const accessToken = items.get("access_token")
@@ -90,6 +93,6 @@ export const POST: RequestHandler = async ({ request, cookies }) => {
}
return json({
- ok: true
+ ok: true,
})
-};
+}
diff --git a/src/routes/character/+page.server.ts b/src/routes/character/+page.server.ts
index 47ca0a47..b58b0de3 100644
--- a/src/routes/character/+page.server.ts
+++ b/src/routes/character/+page.server.ts
@@ -1,14 +1,14 @@
-import { error } from '@sveltejs/kit';
-import type { PageServerLoad } from './$types';
-import { db } from "$lib/server/db/db.client";
+import { db } from "$lib/server/db/db.client"
+import { error } from "@sveltejs/kit"
+import type { PageServerLoad } from "./$types"
export const load: PageServerLoad = async () => {
- const characters = await db.character.findMany();
+ const characters = await db.character.findMany()
if (!characters) {
- error(404, 'Not found');
+ error(404, "Not found")
}
return {
- characters
+ characters,
}
-};
\ No newline at end of file
+}
diff --git a/src/routes/character/+page.svelte b/src/routes/character/+page.svelte
index 4c0ba623..51c5545c 100644
--- a/src/routes/character/+page.svelte
+++ b/src/routes/character/+page.svelte
@@ -1,7 +1,7 @@
diff --git a/src/routes/character/[slug]/+page.server.ts b/src/routes/character/[slug]/+page.server.ts
index 90676216..49ea937b 100644
--- a/src/routes/character/[slug]/+page.server.ts
+++ b/src/routes/character/[slug]/+page.server.ts
@@ -1,18 +1,18 @@
-import { error } from '@sveltejs/kit';
-import type { PageServerLoad } from './$types';
-import { db } from "$lib/server/db/db.client";
+import { db } from "$lib/server/db/db.client"
+import { error } from "@sveltejs/kit"
+import type { PageServerLoad } from "./$types"
export const load: PageServerLoad = async ({ params }) => {
const id = params.slug
const character = await db.character.findFirst({
- where: { id }
- });
+ where: { id },
+ })
if (!character) {
- error(404, 'Not found');
+ error(404, "Not found")
}
return {
- character
+ character,
}
-};
\ No newline at end of file
+}
diff --git a/src/routes/character/[slug]/+page.svelte b/src/routes/character/[slug]/+page.svelte
index 0c6cd6c5..5bed906a 100644
--- a/src/routes/character/[slug]/+page.svelte
+++ b/src/routes/character/[slug]/+page.svelte
@@ -1,8 +1,8 @@
diff --git a/src/routes/p/+page.server.ts b/src/routes/p/+page.server.ts
index 577e0c3f..ce8ab11e 100644
--- a/src/routes/p/+page.server.ts
+++ b/src/routes/p/+page.server.ts
@@ -1,6 +1,6 @@
-import { redirect } from "@sveltejs/kit";
-import type { PageServerLoad } from './$types';
+import { redirect } from "@sveltejs/kit"
+import type { PageServerLoad } from "./$types"
export const load = (async () => {
redirect(301, "/")
-}) satisfies PageServerLoad
\ No newline at end of file
+}) satisfies PageServerLoad
diff --git a/src/routes/p/[slug]/+page.server.ts b/src/routes/p/[slug]/+page.server.ts
index f9a5091f..7da76d34 100644
--- a/src/routes/p/[slug]/+page.server.ts
+++ b/src/routes/p/[slug]/+page.server.ts
@@ -1,18 +1,18 @@
-import { error } from '@sveltejs/kit';
-import type { PageServerLoad } from './$types';
-import { db } from "$lib/server/db/db.client";
+import { db } from "$lib/server/db/db.client"
+import { error } from "@sveltejs/kit"
+import type { PageServerLoad } from "./$types"
export const load = (async ({ params }) => {
const userName = params.slug
const profile = await db.profile.findFirst({
- where: { userName }
- });
+ where: { userName },
+ })
if (!profile) {
- error(404, 'Not found');
+ error(404, "Not found")
}
return {
- profile
+ profile,
}
-}) satisfies PageServerLoad
\ No newline at end of file
+}) satisfies PageServerLoad
diff --git a/src/routes/p/[slug]/+page.svelte b/src/routes/p/[slug]/+page.svelte
index d96dd1e6..ffc43a12 100644
--- a/src/routes/p/[slug]/+page.svelte
+++ b/src/routes/p/[slug]/+page.svelte
@@ -1,7 +1,7 @@