]> git.cworth.org Git - empires-server/blobdiff - tictactoe.js
tictactoe: Use empty strings instead of null objects for empty squares
[empires-server] / tictactoe.js
index 11b4295df247ced277c82d8f1501369483a7a4e0..f9b357bf3202dfbc84443818dbd3626958e5f307 100644 (file)
@@ -4,10 +4,10 @@ const Game = require("./game.js");
 const router = express.Router();
 
 class TicTacToe extends Game {
-  constructor() {
-    super();
+  constructor(id) {
+    super(id);
     this.moves = [];
-    this.board = Array(9).fill(null);
+    this.board = Array(9).fill("");
   }
 
   /* Returns Boolean indicating whether move was legal and added. */
@@ -65,5 +65,3 @@ TicTacToe.meta = {
   name: "Tic Tac Toe",
   identifier: "tictactoe"
 };
-
-exports.meta = TicTacToe.meta;