LoggerEngine을 이어붙이기

This commit is contained in:
2024-03-12 16:57:02 +00:00
parent cdfaac773a
commit 533400b1b9
3 changed files with 15 additions and 2 deletions
+9 -1
View File
@@ -29,8 +29,12 @@ export class GameLoggerEngine {
) {
}
public static initInstance(rsc: IResourceController) {
public static initInstance(rsc: IResourceController): GameLoggerEngine{
if(GameLoggerEngine.instance){
throw new Error("GameLogger is already initialized");
}
GameLoggerEngine.instance = new GameLoggerEngine(rsc);
return GameLoggerEngine.instance;
}
public static getInstance(): GameLoggerEngine {
@@ -61,8 +65,12 @@ export class GameLoggerEngine {
}
flushAll() {
if(this.logStack.size === 0){
return;
}
//rsc?
throw new Error("Not yet implemented");
this.logStack.clear();
}
}
+1
View File
@@ -2,5 +2,6 @@ export * from "./LogicFunc/generalStats.js";
export * as defs from "./defs.js";
export * from "./IResourceController.js";
export * from "./ActionRequest/index.js";
export * from "./GameLogger.js";
// NOTE: game_logic은 client, server 모두에서 사용되는 라이브러리이다.
// DB에 접근한다면 DI여야하나?