Fix: restructing session manager, ES6 -> ES5

This commit is contained in:
2018-09-14 22:22:22 +09:00
parent 72e7c1a28f
commit 3f340535ac
44 changed files with 3100 additions and 3262 deletions
+31 -39
View File
@@ -1,51 +1,43 @@
class RankingRecord {
constructor(rank, playerID, playerName, bestRecord) {
this.rank = rank;
this.playerID = playerID;
this.playerName = playerName;
this.bestRecord = bestRecord;
}
function RankingRecord(rank, playerID, playerName, bestRecord) {
this.rank = rank;
this.playerID = playerID;
this.playerName = playerName;
this.bestRecord = bestRecord;
}
function RankingRecordManager() {
this.clear();
}
class RankingRecordManager {
RankingRecordManager.prototype.push = function(RankingRecord) {
this.rankingRecords.push(RankingRecord);
}
constructor() {
this.clear();
}
RankingRecordManager.prototype.clear = function() {
this.rankingRecords = [];
}
push(RankingRecord) {
this.rankingRecords.push(RankingRecord);
}
RankingRecordManager.prototype.getCount = function() {
return this.rankingRecords.length;
}
clear() {
this.rankingRecords = [];
}
RankingRecordManager.prototype.getAt = function(index) {
return this.rankingRecords[index];
}
get count() {
return this.rankingRecords.length;
}
RankingRecordManager.prototype.getRankAt = function(index) {
return this.rankingRecords[index].rank;
}
getAt(index) {
return this.rankingRecords[index];
}
RankingRecordManager.prototype.getPlayerIDAt = function(index) {
return this.rankingRecords[index].playerID;
}
getRankAt(index) {
return this.rankingRecords[index].rank;
}
getPlayerIDAt(index) {
return this.rankingRecords[index].playerID;
}
getPlayerNameAt(index) {
return this.rankingRecords[index].playerName;
}
getBestRecordAt(index) {
return this.rankingRecords[index].bestRecord;
}
RankingRecordManager.prototype.getPlayerNameAt = function(index) {
return this.rankingRecords[index].playerName;
}
RankingRecordManager.prototype.getBestRecordAt = function(index) {
return this.rankingRecords[index].bestRecord;
}