Grid constructor

Grid(
  1. dynamic width,
  2. dynamic height, [
  3. dynamic matrix
])

Implementation

Grid(width, height, [matrix]) {
  /**
   * The number of columns of the grid.
   * @type number
   */
  this.width = width;
  /**
   * The number of rows of the grid.
   * @type number
   */
  this.height = height;

  /**
   * A 2D array of nodes.
   */
  this.nodes = _buildNodes(width, height, matrix);
}