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
|
export class Game
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The width of the board.
|
||||||
|
*/
|
||||||
|
static #width = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The height of the board.
|
||||||
|
*/
|
||||||
|
static #height = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The state of the game.
|
* The state of the game.
|
||||||
*
|
*
|
||||||
|
@ -74,9 +84,9 @@ export class Game
|
||||||
let board = document.getElementById(this.id);
|
let board = document.getElementById(this.id);
|
||||||
board.innerHTML = "";
|
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[]} */
|
/** @type {Node[]} */
|
||||||
let children = [];
|
let children = [];
|
||||||
|
|
Loading…
Reference in a new issue