diff --git a/src/App.ts b/src/App.ts index e128dbe..1847646 100644 --- a/src/App.ts +++ b/src/App.ts @@ -1,7 +1,6 @@ import DOMRenderer from "./Graphics/DOM/DOMRenderer"; import { el, style } from "./Helpers/DOM"; import TileServiceInterface from "./Interfaces/TileServiceInterface"; -import SimpleTileService from "./Services/SimpleTileService"; import APITileService from "./Services/APITileService"; export default class App { diff --git a/src/Graphics/DOM/DOMRenderer.ts b/src/Graphics/DOM/DOMRenderer.ts index 1811c84..8378145 100644 --- a/src/Graphics/DOM/DOMRenderer.ts +++ b/src/Graphics/DOM/DOMRenderer.ts @@ -1,7 +1,5 @@ import App from "@/App"; import DOMTile from "./DOMTile"; -import TileData from "@/Interfaces/TileData"; -import TileMaterial from "@/Enums/TileMaterial"; export default class DOMRenderer { offset: { x: number; y: number }; diff --git a/src/Interfaces/TileServiceInterface.ts b/src/Interfaces/TileServiceInterface.ts index 750afa1..931d32c 100644 --- a/src/Interfaces/TileServiceInterface.ts +++ b/src/Interfaces/TileServiceInterface.ts @@ -1,5 +1,4 @@ import Tile from "./Tile"; -import TileData from "./TileData"; export default interface TileServiceInterface { loadTileData: (x: number, y: number, tile: Tile) => void; diff --git a/src/Services/APITileService.ts b/src/Services/APITileService.ts index 17fe5b5..c8070c2 100644 --- a/src/Services/APITileService.ts +++ b/src/Services/APITileService.ts @@ -31,9 +31,8 @@ export default class APITileService implements TileServiceInterface { loadTileData(x: number, y: number, tile: Tile) { this.buffer.add([x, y, tile]); } - generateTile(x: number, y: number) { + generateTile(_x: number, _y: number) { const material = getRandomEnumValue(TileMaterial); - return { zLevel: 0, material: material, diff --git a/src/Services/SimpleTileService.ts b/src/Services/SimpleTileService.ts index 203be67..03e0966 100644 --- a/src/Services/SimpleTileService.ts +++ b/src/Services/SimpleTileService.ts @@ -6,17 +6,17 @@ import TileServiceInterface from "@/Interfaces/TileServiceInterface"; const TILE_STORE: { [key: string]: TileData } = {}; export default class SimpleTileService implements TileServiceInterface { - async getTileData(x: number, y: number): Promise { - return new Promise((resolve, reject) => { + async loadTileData(x: number, y: number): Promise { + return new Promise((resolve) => { const key = `${x},${y}`; if (TILE_STORE[key]) { return TILE_STORE[key]; } - TILE_STORE[key] = this.generateTile(x, y); + TILE_STORE[key] = this.generateTile(); resolve(TILE_STORE[key]); }); } - generateTile(x: number, y: number) { + generateTile() { const material = getRandomEnumValue(TileMaterial); return {