@@ -2,8 +2,12 @@ import { ipcMain } from 'electron';
2
2
import { toUpperSnakeCase } from '../../common/string/string.utils.js' ;
3
3
import type { AccountService } from '../account/types.js' ;
4
4
import { Game } from '../game/game.instance.js' ;
5
+ import type { LayoutService } from '../layout/types.js' ;
6
+ import { deleteLayoutHandler } from './handlers/delete-layout.js' ;
7
+ import { getLayoutHandler } from './handlers/get-layout.js' ;
5
8
import { listAccountsHandler } from './handlers/list-accounts.js' ;
6
9
import { listCharactersHandler } from './handlers/list-characters.js' ;
10
+ import { listLayoutNamesHandler } from './handlers/list-layout-names.js' ;
7
11
import { logHandler } from './handlers/log.js' ;
8
12
import { pingHandler } from './handlers/ping.js' ;
9
13
import { playCharacterHandler } from './handlers/play-character.js' ;
@@ -12,6 +16,7 @@ import { removeAccountHandler } from './handlers/remove-account.js';
12
16
import { removeCharacterHandler } from './handlers/remove-character.js' ;
13
17
import { saveAccountHandler } from './handlers/save-account.js' ;
14
18
import { saveCharacterHandler } from './handlers/save-character.js' ;
19
+ import { saveLayoutHandler } from './handlers/save-layout.js' ;
15
20
import { sendCommandHandler } from './handlers/send-command.js' ;
16
21
import { logger } from './logger.js' ;
17
22
import type {
@@ -23,14 +28,17 @@ import type {
23
28
export class IpcController {
24
29
private dispatch : IpcDispatcher ;
25
30
private accountService : AccountService ;
31
+ private layoutService : LayoutService ;
26
32
private handlerRegistry : IpcHandlerRegistry ;
27
33
28
34
constructor ( options : {
29
35
dispatch : IpcDispatcher ;
30
36
accountService : AccountService ;
37
+ layoutService : LayoutService ;
31
38
} ) {
32
39
this . dispatch = options . dispatch ;
33
40
this . accountService = options . accountService ;
41
+ this . layoutService = options . layoutService ;
34
42
this . handlerRegistry = this . createHandlerRegistry ( ) ;
35
43
this . registerHandlers ( this . handlerRegistry ) ;
36
44
}
@@ -89,6 +97,22 @@ export class IpcController {
89
97
dispatch : this . dispatch ,
90
98
} ) ,
91
99
100
+ getLayout : getLayoutHandler ( {
101
+ layoutService : this . layoutService ,
102
+ } ) ,
103
+
104
+ listLayoutNames : listLayoutNamesHandler ( {
105
+ layoutService : this . layoutService ,
106
+ } ) ,
107
+
108
+ saveLayout : saveLayoutHandler ( {
109
+ layoutService : this . layoutService ,
110
+ } ) ,
111
+
112
+ deleteLayout : deleteLayoutHandler ( {
113
+ layoutService : this . layoutService ,
114
+ } ) ,
115
+
92
116
sendCommand : sendCommandHandler ( {
93
117
dispatch : this . dispatch ,
94
118
} ) ,
0 commit comments