Commit | Line | Data |
---|---|---|
4198ad5c JB |
1 | import AbstractUIService from './AbstractUIService'; |
2 | import { ProtocolVersion } from '../../types/UIProtocol'; | |
3 | import UIService_0_0_1 from './UIService_0_0_1'; | |
4 | import UIWebSocketServer from '../UIWebSocketServer'; | |
5 | ||
6 | export default class UIServiceFactory { | |
7 | private constructor() { | |
8 | // This is intentional | |
9 | } | |
10 | ||
11 | public static getUIServiceImplementation(version: ProtocolVersion, uiWebSocketServer: UIWebSocketServer): AbstractUIService | null { | |
12 | switch (version) { | |
13 | case ProtocolVersion['0.0.1']: | |
14 | return new UIService_0_0_1(uiWebSocketServer); | |
15 | default: | |
16 | return null; | |
17 | } | |
18 | } | |
19 | } |