From ed5eaf0d55812b64c1ef5a42543bdb8f98c2994e Mon Sep 17 00:00:00 2001 From: garrettmills Date: Mon, 7 Sep 2020 15:29:35 -0500 Subject: [PATCH] Modify game board to fetch state from game service (#1) --- src/components/GameBoard.component.js | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/components/GameBoard.component.js b/src/components/GameBoard.component.js index 7cee4a8..89973e7 100644 --- a/src/components/GameBoard.component.js +++ b/src/components/GameBoard.component.js @@ -1,5 +1,5 @@ import {Component} from '../../lib/vues6.js' -import {GridCellState} from '../module/util.js' +import game_service from '../services/GameState.service.js' /* * This is the HTML/JavaScript for the game board component. @@ -50,28 +50,8 @@ export default class GameBoardComponent extends Component { */ rows = [] - /** - * The number of rows in the grid. - * @type {number} - */ - n_rows = 9 - - /** - * The number of columns in a row. - * @type {number} - */ - n_cols = 9 - async vue_on_create() { - // Generate the data structure for the grid - this.rows = Array(this.n_rows).fill('').map(_ => { - return Array(this.n_cols).fill('').map(_ => { - return { - render: GridCellState.Available, - } - }) - }) - + this.rows = game_service.get_current_player_state() this.ready = true } }