Refactor EditorManager to use Tools type and remove unnecessary whitespace in Hammer class; add Tools type definition.

This commit is contained in:
2025-12-18 08:31:53 +01:00
parent 053fa0082f
commit c094bc7639
4 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
import type { Tools } from "../type";
export class EditorManager {
tool : "draw" | "eraser" = "draw";
tool : Tools = "draw";
selected_tile: number = 0;
displayImageEaster: boolean = false;
tileMap: { x: number, y: number, tile: number }[] = [];

View File

@@ -78,8 +78,6 @@ export class Hammer {
return this.hconsole.push("An error has occurred !", "ERROR");
}
resetTiles() {
if (this.helements.elements.div_view_tiles)
this.helements.elements.div_view_tiles.innerHTML = "";

View File

5
src/type.d.ts vendored Normal file
View File

@@ -0,0 +1,5 @@
export type Tools = 'draw' | 'eraser';
export type Action = {
type: Tools;
data: any;
}