@technote-space/game-interface
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -5,2 +5,3 @@ import { IGame } from './IGame'; | ||
private _step; | ||
private _hasFinished; | ||
private readonly _gameSettings; | ||
@@ -13,2 +14,3 @@ private readonly _gaSettings; | ||
get hasReached(): boolean; | ||
protected onFinished(): void; | ||
protected abstract getGameSettings(): GameSettings; | ||
@@ -15,0 +17,0 @@ protected abstract getGaSettings(): GaSettings; |
@@ -16,2 +16,3 @@ "use strict"; | ||
this._step = 0; | ||
this._hasFinished = false; | ||
this._gameSettings = this.getGameSettings(); | ||
@@ -30,7 +31,11 @@ this._gaSettings = this.getGaSettings(); | ||
get hasReached() { | ||
return this.step >= this.gameSettings.stepLimit; | ||
return this._hasFinished || this.step >= this.gameSettings.stepLimit; | ||
} | ||
onFinished() { | ||
this._hasFinished = true; | ||
} | ||
reset() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
this._step = 0; | ||
this._hasFinished = false; | ||
yield this.performReset(); | ||
@@ -37,0 +42,0 @@ }); |
{ | ||
"name": "@technote-space/game-interface", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
17707
250