Fix: App ranking TDD

This commit is contained in:
2019-06-04 22:52:01 +09:00
parent 26fb8bbf57
commit 27bde43cae
2 changed files with 153 additions and 97 deletions
+15
View File
@@ -23,21 +23,36 @@ RankingRecordManager.prototype.getCount = function() {
}
RankingRecordManager.prototype.getAt = function(index) {
if(typeof(this.rankingRecords[index]) == "undefined")
return null;
return this.rankingRecords[index];
}
RankingRecordManager.prototype.getRankAt = function(index) {
if(typeof(this.rankingRecords[index]) == "undefined")
return -1;
return this.rankingRecords[index].rank;
}
RankingRecordManager.prototype.getPlayerIDAt = function(index) {
if(typeof(this.rankingRecords[index]) == "undefined")
return -1;
return this.rankingRecords[index].playerID;
}
RankingRecordManager.prototype.getPlayerNameAt = function(index) {
if(typeof(this.rankingRecords[index]) == "undefined")
return "no data";
return this.rankingRecords[index].playerName;
}
RankingRecordManager.prototype.getBestRecordAt = function(index) {
if(typeof(this.rankingRecords[index]) == "undefined")
return -1;
return this.rankingRecords[index].bestRecord;
}