This name is already not used anywhere, (the code has since changed to
using Game.meta.identifier instead), so kill it.
And this lets us frop the global "engine_name" variable from each
game's JavaScript file (which had a value redundant with
meta.identifier anyway).
const express = require("express");
const Game = require("./game.js");
const express = require("express");
const Game = require("./game.js");
-const engine_name = "empires";
-
const router = express.Router();
const GameState = {
const router = express.Router();
const GameState = {
class Empires extends Game {
constructor() {
class Empires extends Game {
constructor() {
this._spectators = [];
this.next_spectator_id = 1;
this._players = [];
this._spectators = [];
this.next_spectator_id = 1;
this._players = [];
/* Base class providing common code for game engine implementations. */
class Game {
/* Base class providing common code for game engine implementations. */
class Game {
- constructor(name) {
- this.name = name;
this.clients = [];
this.next_client_id = 1;
}
this.clients = [];
this.next_client_id = 1;
}
const express = require("express");
const Game = require("./game.js");
const express = require("express");
const Game = require("./game.js");
-const engine_name = "tictactoe";
-
const router = express.Router();
class TicTacToe extends Game {
constructor() {
const router = express.Router();
class TicTacToe extends Game {
constructor() {
this.moves = [];
this.board = Array(9).fill(null);
}
this.moves = [];
this.board = Array(9).fill(null);
}