denque
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
"@sammo/util": "workspace:^",
|
||||
"@strpc/express": "workspace:^",
|
||||
"date-fns": "^3.3.1",
|
||||
"denque": "^2.1.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"eventemitter3": "^5.0.1",
|
||||
"express": "^4.18.3",
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import Denque from "denque";
|
||||
|
||||
export class GameEngine {
|
||||
|
||||
private static instance: GameEngine | null = null;
|
||||
|
||||
private npcActionQueue = new Denque<unknown>();
|
||||
private apiActionQueue = new Denque<unknown>();
|
||||
|
||||
private constructor() {
|
||||
|
||||
}
|
||||
|
||||
public static getInstance() {
|
||||
if (!GameEngine.instance) {
|
||||
GameEngine.instance = new GameEngine();
|
||||
}
|
||||
return GameEngine.instance;
|
||||
}
|
||||
|
||||
public async start() {
|
||||
|
||||
console.log('GameEngine started');
|
||||
}
|
||||
|
||||
public async stop() {
|
||||
console.log('GameEngine stopped');
|
||||
}
|
||||
|
||||
}
|
||||
Generated
+8
@@ -414,6 +414,9 @@ importers:
|
||||
date-fns:
|
||||
specifier: ^3.3.1
|
||||
version: 3.3.1
|
||||
denque:
|
||||
specifier: ^2.1.0
|
||||
version: 2.1.0
|
||||
dotenv:
|
||||
specifier: ^16.4.5
|
||||
version: 16.4.5
|
||||
@@ -2900,6 +2903,11 @@ packages:
|
||||
object-keys: 1.1.1
|
||||
dev: true
|
||||
|
||||
/denque@2.1.0:
|
||||
resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==}
|
||||
engines: {node: '>=0.10'}
|
||||
dev: false
|
||||
|
||||
/depd@2.0.0:
|
||||
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
|
||||
engines: {node: '>= 0.8'}
|
||||
|
||||
Reference in New Issue
Block a user