- constructor() {
- super(engine_name);
- this.moves = [];
- this.board = Array(9).fill(null);
- }
-
- /* Returns Boolean indicating whether move was legal and added. */
- add_move(square) {
- /* Cannot move to an occupied square. */
- if (this.board[square])
- return false;
-
- this.board[square] = 'X';
- this.moves.push(square);
-
- return true;
+ constructor(id) {
+ super(id);
+ this.teams = [
+ {
+ id: 0,
+ name: "X"
+ },
+ {
+ id: 1,
+ name: "O"
+ }];
+ this.state = {
+ moves: [],
+ board: Array(9).fill(""),
+ team_to_play: this.teams[0],
+ };