Skip to content

Commit

Permalink
Fixed some small build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkibbler committed Oct 8, 2024
1 parent 76feb7f commit b62a57f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/App.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/Graphics/DOM/DOMRenderer.ts
Original file line number Diff line number Diff line change
@@ -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 };
Expand Down
1 change: 0 additions & 1 deletion src/Interfaces/TileServiceInterface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Tile from "./Tile";
import TileData from "./TileData";

export default interface TileServiceInterface {
loadTileData: (x: number, y: number, tile: Tile) => void;
Expand Down
3 changes: 1 addition & 2 deletions src/Services/APITileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/Services/SimpleTileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TileData> {
return new Promise((resolve, reject) => {
async loadTileData(x: number, y: number): Promise<TileData> {
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 {
Expand Down

0 comments on commit b62a57f

Please sign in to comment.