2018-03-07 09:48:32 +01:00
|
|
|
import StreamManager from './stream-manager';
|
|
|
|
import Stream from './stream';
|
2018-04-29 14:37:51 +02:00
|
|
|
import MiOS from '../../../mios';
|
2018-03-07 09:48:32 +01:00
|
|
|
|
|
|
|
export class OthelloStream extends Stream {
|
2018-03-15 11:53:46 +01:00
|
|
|
constructor(os: MiOS, me) {
|
|
|
|
super(os, 'othello', {
|
2018-04-07 20:58:11 +02:00
|
|
|
i: me.token
|
2018-03-07 09:48:32 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class OthelloStreamManager extends StreamManager<OthelloStream> {
|
|
|
|
private me;
|
2018-03-15 11:53:46 +01:00
|
|
|
private os: MiOS;
|
2018-03-07 09:48:32 +01:00
|
|
|
|
2018-03-15 11:53:46 +01:00
|
|
|
constructor(os: MiOS, me) {
|
2018-03-07 09:48:32 +01:00
|
|
|
super();
|
|
|
|
|
|
|
|
this.me = me;
|
2018-03-15 11:53:46 +01:00
|
|
|
this.os = os;
|
2018-03-07 09:48:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public getConnection() {
|
|
|
|
if (this.connection == null) {
|
2018-03-15 11:53:46 +01:00
|
|
|
this.connection = new OthelloStream(this.os, this.me);
|
2018-03-07 09:48:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return this.connection;
|
|
|
|
}
|
|
|
|
}
|