mirror of
https://github.com/danog/2048.git
synced 2024-11-27 03:44:43 +01:00
small change in scoremanager
This commit is contained in:
parent
a862d44849
commit
88278792be
@ -19,11 +19,7 @@ function LocalScoreManager() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LocalScoreManager.prototype.get = function () {
|
LocalScoreManager.prototype.get = function () {
|
||||||
var score = this.storage.getItem(this.key);
|
return this.storage.getItem(this.key) || 0;
|
||||||
if (typeof score === "undefined" || score === null) {
|
|
||||||
score = 0;
|
|
||||||
}
|
|
||||||
return score;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LocalScoreManager.prototype.set = function (score) {
|
LocalScoreManager.prototype.set = function (score) {
|
||||||
|
Loading…
Reference in New Issue
Block a user