From 6baaa14bde032afa363dbdd50119a20e9f47df1c Mon Sep 17 00:00:00 2001 From: Maks Jopek Date: Mon, 26 Apr 2021 14:43:25 +0200 Subject: Bugfixes: to home, [40] -> [1], not destroying old chequer --- frontend/ts/gameTable.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'frontend/ts/gameTable.ts') diff --git a/frontend/ts/gameTable.ts b/frontend/ts/gameTable.ts index c95ddb2..a0f9c6a 100644 --- a/frontend/ts/gameTable.ts +++ b/frontend/ts/gameTable.ts @@ -1,22 +1,22 @@ import { Coordinates } from "../../helpers/helpersBack"; export default class gameTable { - static numberOfSquaresOnGameBoard = 11; - static gameTable: HTMLTableElement; + static numberOfSquaresOnGameBoard = 11; + static gameTable: HTMLTableElement; - static drawGameTable(): void { - for (let i = 0; i < gameTable.numberOfSquaresOnGameBoard; i++) { - let tr = document.createElement("tr"); - for (let j = 0; j < gameTable.numberOfSquaresOnGameBoard; j++) { - let td = document.createElement("td"); - td.classList.add("chequer"); - td.dataset.count = '0'; - tr.appendChild(td); - } - gameTable.gameTable.appendChild(tr); - } - } - static getTd(coords: Coordinates): HTMLElement { - return gameTable.gameTable.children[coords.y].children[coords.x] as HTMLElement; + static drawGameTable(): void { + for (let i = 0; i < gameTable.numberOfSquaresOnGameBoard; i++) { + let tr = document.createElement("tr"); + for (let j = 0; j < gameTable.numberOfSquaresOnGameBoard; j++) { + let td = document.createElement("td"); + td.classList.add("chequer"); + td.dataset.count = '0'; + tr.appendChild(td); } + gameTable.gameTable.appendChild(tr); + } + } + static getTd(coords: Coordinates): HTMLElement { + return gameTable.gameTable.children[coords.y].children[coords.x] as HTMLElement; + } } \ No newline at end of file -- cgit v1.3.1