add getter comments
This commit is contained in:
@@ -39,6 +39,7 @@ LocalStorageManager.prototype.localStorageSupported = function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Best score getters/setters
|
||||||
LocalStorageManager.prototype.getBestScore = function () {
|
LocalStorageManager.prototype.getBestScore = function () {
|
||||||
return this.storage.getItem(this.bestScoreKey) || 0;
|
return this.storage.getItem(this.bestScoreKey) || 0;
|
||||||
};
|
};
|
||||||
@@ -47,6 +48,7 @@ LocalStorageManager.prototype.setBestScore = function (score) {
|
|||||||
this.storage.setItem(this.bestScoreKey, score);
|
this.storage.setItem(this.bestScoreKey, score);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Game state getters/setters and clearing
|
||||||
LocalStorageManager.prototype.getGameState = function () {
|
LocalStorageManager.prototype.getGameState = function () {
|
||||||
var stateJSON = this.storage.getItem(this.gameStateKey);
|
var stateJSON = this.storage.getItem(this.gameStateKey);
|
||||||
return stateJSON ? JSON.parse(stateJSON) : null;
|
return stateJSON ? JSON.parse(stateJSON) : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user