diff --git a/frontend/main.js b/frontend/main.js index 1741109..142148f 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -20,6 +20,7 @@ class Backend { this.config.makeMove(move); } getAvailableMoves(position) { + position; return []; } } @@ -39,7 +40,9 @@ class Chess { this.configVis.configuration = config; this.configVis.draw(this.canvas); } - showAvailableMoves(canMoveTo) {} + showAvailableMoves(canMoveTo) { + canMoveTo; + } click(ev) { if (this.moveSource === null) { this._firstClick(ev); @@ -68,21 +71,6 @@ class Chess { } } -class Move { - constructor(kind, from, to) { - this.kind = kind; - this.from = from; - this.to = to; - } -} - -class Piece { - constructor(piece_type, color) { - this.piece_type = piece_type; - this.color = color; - } -} - class Configuration { constructor(board) { this.board = new Map(board); diff --git a/frontend/visuals.js b/frontend/visuals.js index 6fdebdf..3742fce 100644 --- a/frontend/visuals.js +++ b/frontend/visuals.js @@ -142,7 +142,7 @@ export class ConfigVis { } } undraw() { - for (let [position, pv] of this.piecesVis) { + for (let pv of this.piecesVis.values()) { pv.undraw(); } this.piecesVis.clear();