1
0
mirror of https://github.com/danog/2048.git synced 2024-11-30 04:19:06 +01:00

add getter comments

This commit is contained in:
Gabriele Cirulli 2014-03-22 16:29:23 +01:00
parent c48b92689d
commit a6531b08bd

View File

@ -39,6 +39,7 @@ LocalStorageManager.prototype.localStorageSupported = function () {
}
};
// Best score getters/setters
LocalStorageManager.prototype.getBestScore = function () {
return this.storage.getItem(this.bestScoreKey) || 0;
};
@ -47,6 +48,7 @@ LocalStorageManager.prototype.setBestScore = function (score) {
this.storage.setItem(this.bestScoreKey, score);
};
// Game state getters/setters and clearing
LocalStorageManager.prototype.getGameState = function () {
var stateJSON = this.storage.getItem(this.gameStateKey);
return stateJSON ? JSON.parse(stateJSON) : null;