2018-05-28 10:07:25 +00:00
|
|
|
import * as plugins from './smartuniverse.plugins';
|
2019-04-11 15:52:01 +00:00
|
|
|
import * as interfaces from './interfaces';
|
2018-05-28 10:07:25 +00:00
|
|
|
|
2019-04-11 15:52:01 +00:00
|
|
|
import { ClientUniverse } from './';
|
2018-05-28 10:07:25 +00:00
|
|
|
|
2019-04-11 15:52:01 +00:00
|
|
|
export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
2018-05-28 10:07:25 +00:00
|
|
|
// ======
|
|
|
|
// STATIC
|
|
|
|
// ======
|
|
|
|
public static async createClientUniverseChannel(
|
|
|
|
clientUniverseArg: ClientUniverse,
|
|
|
|
channelName: string
|
|
|
|
): Promise<ClientUniverseChannel> {
|
|
|
|
const clientChannel = new ClientUniverseChannel(clientUniverseArg);
|
|
|
|
await clientChannel.transmitSubscription();
|
|
|
|
return clientChannel;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========
|
|
|
|
// INSTANCE
|
|
|
|
// ========
|
|
|
|
|
|
|
|
public clientUniverse: ClientUniverse;
|
|
|
|
|
|
|
|
constructor(clientUniverseArg: ClientUniverse) {
|
|
|
|
this.clientUniverse = clientUniverseArg;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* tells the universe about this instances interest into a channel
|
|
|
|
*/
|
|
|
|
public async transmitSubscription() {
|
|
|
|
this.clientUniverse.socketClient;
|
|
|
|
}
|
|
|
|
}
|