diff options
| author | Maks Jopek <maksymilian.jopek@prym-soft.pl> | 2021-04-25 12:07:36 +0200 |
|---|---|---|
| committer | Maks Jopek <maksymilian.jopek@prym-soft.pl> | 2021-04-25 12:07:36 +0200 |
| commit | 013319d7a4651d1708280f556e39c2f03839426a (patch) | |
| tree | 704e51c6d4d96360611819628be3c78edec2f9d8 /frontend/ts/gameTable.ts | |
| parent | 13dcc2c8fc1d11e3b94432fffc4c4f186bd94d29 (diff) | |
| download | fia-013319d7a4651d1708280f556e39c2f03839426a.tar.gz fia-013319d7a4651d1708280f556e39c2f03839426a.tar.zst fia-013319d7a4651d1708280f556e39c2f03839426a.zip | |
Almost going in a circle
Diffstat (limited to 'frontend/ts/gameTable.ts')
| -rw-r--r-- | frontend/ts/gameTable.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/ts/gameTable.ts b/frontend/ts/gameTable.ts new file mode 100644 index 0000000..c95ddb2 --- /dev/null +++ b/frontend/ts/gameTable.ts @@ -0,0 +1,22 @@ +import { Coordinates } from "../../helpers/helpersBack"; + +export default class gameTable { + 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; + } +}
\ No newline at end of file |
