From 6bdee0edc48438758dbecf6ce811f19ac35dfe6d Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 17 Oct 2022 16:18:39 -0400 Subject: [PATCH] Another quick backend fix. --- src/backend.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/backend.js b/src/backend.js index 28f72c8..eb5bf58 100644 --- a/src/backend.js +++ b/src/backend.js @@ -1,4 +1,4 @@ -const { Piece } = require('./logic') +const { Piece, startingBoard } = require('./logic') const BLACK = 0; const WHITE = 1; @@ -27,22 +27,10 @@ function settingText(setting) { } } -function range(n) { - return Array.from(Array(n).keys()); -} - -function imageFromPiece(piece) { - if (piece && piece.type >= 0) { - const image = piece.color === WHITE ? piece.type : piece.type + 6; - return Images[image]; - } - return null; -} - class Board { constructor(props) { this.state = props?.text ? - this.stateFromText(props.text) : this.originalState(); + this.stateFromText(props.text) : startingBoard(); } setHand(hand) {