This commit is contained in:
syuilo
2018-03-15 19:53:46 +09:00
parent f02fcd0e2a
commit 1439c3245b
22 changed files with 446 additions and 101 deletions

View File

@@ -1,9 +1,10 @@
import StreamManager from './stream-manager';
import Stream from './stream';
import MiOS from '../../mios';
export class OthelloStream extends Stream {
constructor(me) {
super('othello', {
constructor(os: MiOS, me) {
super(os, 'othello', {
i: me.token
});
}
@@ -11,16 +12,18 @@ export class OthelloStream extends Stream {
export class OthelloStreamManager extends StreamManager<OthelloStream> {
private me;
private os: MiOS;
constructor(me) {
constructor(os: MiOS, me) {
super();
this.me = me;
this.os = os;
}
public getConnection() {
if (this.connection == null) {
this.connection = new OthelloStream(this.me);
this.connection = new OthelloStream(this.os, this.me);
}
return this.connection;