From 6b9c59920a22b99e5a222276d62bb8a560d8eae8 Mon Sep 17 00:00:00 2001 From: A Bass Date: Sat, 30 Apr 2022 16:20:03 -0400 Subject: [PATCH] Revert Multi-room code. I don't understand it --- index.js | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/index.js b/index.js index fdfff5e..c7bb091 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,6 @@ const gridSize = [18, 18]; const perlinScale = 3; var express = require('express'); -<<<<<<< HEAD class Server { constructor(){ this.games = [] @@ -42,49 +41,6 @@ class Server { } } -class Game { - constructor(gridSize, roomName) { - this.name = roomName - this.players = []; - this.world = new World(gridSize, perlinScale); - this.gridSize = gridSize - } - - addPlayer(id, name) { - var color - switch(util.randomNumber(1,4)) { - case 1: - color = "red"; - break; - - case 2: - color = "aquamarine"; - break; - - case 3: - color = "green"; - break; - - case 4: - color = "yellow"; - break; - } - const player = new Player(id, color, name); - this.players.push(player); - console.log(player.name) - } - - removePlayer(id) { - this.players = this.players.filter(obj => obj.id != id); - console.log("removed player - " + id) - } - - getPlayerByID(id) { - const player = this.players.filter(obj => obj.id == id)[0] - return player - } - -} class Player { @@ -92,13 +48,6 @@ class Player { this.id = id; this.color = color; } -======= -class Player { - constructor(id, color) { - this.id = id; - this.color = color; - } ->>>>>>> parent of 9f1bf7e (Good enough for now) } class Game {