-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.js
More file actions
35 lines (30 loc) · 854 Bytes
/
Main.js
File metadata and controls
35 lines (30 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const WSServer = require('./WebSocketServer')
const UserInterface = require('./UserInterface');
const EventEmitter = require('events');
class Main {
eventBus = new EventEmitter();
turtles = [];
world = [];
gui;
server;
constructor() {
//Start GUI
console.log("Starting GUI");
try {
this.gui = new UserInterface.GUI(this);
} catch(err) {
console.log("GUI Initialization Failed.")
throw(err);
}
console.log("GUI Open")
// Initialize Server
console.log("Initializing Server");
try {
this.server = new WSServer.Server(this, 8080);
} catch(err) {
console.log("Server Initialization Failed.")
throw(err);
}
}
}
var main = new Main();