aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/ts/gameTable.ts
diff options
context:
space:
mode:
authorMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-04-26 14:43:25 +0200
committerMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-04-26 14:43:25 +0200
commit6baaa14bde032afa363dbdd50119a20e9f47df1c (patch)
tree82e7ba81f36e725e282eadd5c8c61f4304b1bf85 /frontend/ts/gameTable.ts
parent013319d7a4651d1708280f556e39c2f03839426a (diff)
downloadfia-6baaa14bde032afa363dbdd50119a20e9f47df1c.tar.gz
fia-6baaa14bde032afa363dbdd50119a20e9f47df1c.tar.zst
fia-6baaa14bde032afa363dbdd50119a20e9f47df1c.zip
Bugfixes: to home, [40] -> [1], not destroying old chequer
Diffstat (limited to 'frontend/ts/gameTable.ts')
-rw-r--r--frontend/ts/gameTable.ts32
1 files changed, 16 insertions, 16 deletions
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