Store the board size as static variables
This commit is contained in:
parent
7950572ede
commit
2cf011ed03
|
@ -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 = [];
|
||||
|
|
Loading…
Reference in a new issue