Store the board size as static variables

This commit is contained in:
Manuel Thalmann 2022-12-13 11:12:06 +01:00
parent 7950572ede
commit 2cf011ed03
No known key found for this signature in database
GPG key ID: 5FD9AD3CCDDBD27B

View file

@ -7,6 +7,16 @@ import { State } from "./State.js";
*/
export class Game
{
/**
* The width of the board.
*/
static #width = 7;
/**
* The height of the board.
*/
static #height = 6;
/**
* The state of the game.
*
@ -74,9 +84,9 @@ export class Game
let board = document.getElementById(this.id);
board.innerHTML = "";
for (let i = 0; i < 6; i++)
for (let i = 0; i < Game.#height; i++)
{
for (let j = 0; j < 7; j++)
for (let j = 0; j < Game.#width; j++)
{
/** @type {Node[]} */
let children = [];