-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add argument RunnerStartParameters of Runner#start() #272
Conversation
@@ -138,6 +138,25 @@ describe("Runner の動作確認 (v1)", () => { | |||
|
|||
runner.stop(); | |||
}); | |||
|
|||
xit("Runner#start({paused:true}) でコンテンツは進行しない", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xit
でスキップとしていますが、ローカルでは it
でテストが通る事を確認しています。
it
に直すのは CI環境 で確認したいので、別のタスクとさせてください。
if (!paused) { | ||
this.running = true; | ||
game = await this.startGameDriver(); | ||
} else { | ||
this.running = false; | ||
this.platform?.pauseLoopers(); // コンテンツ開始前に停止する | ||
this.driver!.startGame(); | ||
game = this.driver!._game; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他のコメントの議論とコンフリクトしそうな話になりますが、そもそもこんな難しい形の実装になってしまうんですっけ……?
initGameDriver()
は常にpauseLoopers()
する- このメソッドは
!paused
ならresumeLoopers()
する
というだけの話では済まないでしょうか? startGame()
する箇所が二箇所に増えるとか、できれば避けたいように思えますが。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
別途ご相談とさせてください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
別途ご相談させていただいた内容で修正しました。
CI 環境で |
@@ -210,7 +213,9 @@ export class RunnerV1 extends Runner { | |||
reject(e); | |||
return; | |||
} | |||
this.pause(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize()
を挟むと非同期が絡むので、 platform
の生成直後に pause()
してしまいたいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform
生成直後に this.pause()
するよう修正しました。
生成直後だと Platform#createLooper()
がまだ実行されないため、isLooperPaused
フラグを追加し、createLooper()
で looper 生成時に stop 状態なら、debugStop()
した looper を返すように修正しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
はい。Runner が looper の生成タイミングに依存するべきではないので、適切な対応だと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントつけていますが approved.
@@ -22,6 +22,14 @@ export interface RunnerParameters { | |||
externalValue?: { [key: string]: any }; | |||
} | |||
|
|||
export interface RunnerStartParameters { | |||
/** | |||
* コンテンツの進行を停止するかどうか。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「停止」は stop()
に対応しているので、 pause()
に合わせて「一時停止」にしたいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"一時停止" に修正しました。
@@ -233,7 +237,11 @@ export class RunnerV3 extends Runner { | |||
reject(e); | |||
return; | |||
} | |||
if (!result) { | |||
return reject(new Error("Game is null.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
内部動作的には、 configurationUrl
を渡しているのでこのパスに来ることはないはずです。「 GameDriver
の内部実装上ここに来ることはないはずだが念のため確認」というコメントをつけておきたいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメント追加しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (念の為) 機能追加なのでマイナーバージョンの更新でお願いします。
- PullRequestのタイトルの再確認をお願いします。
概要
Runner#start()
に引数{ paused?: boolean }
を追加します。paused
が真の場合はコンテンツの進行を停止した状態でg.game
のインスタンスを返します 。