sharkey/src/client/app/common/scripts/streaming/othello.ts

32 lines
570 B
TypeScript
Raw Normal View History

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