Add: RankingRecordManager
This commit is contained in:
@@ -1,38 +1,76 @@
|
||||
class DBConnectManager {
|
||||
|
||||
constructor() {
|
||||
this.maestroID = 0;
|
||||
this.playerUserID = 0;
|
||||
this.appName = "";
|
||||
}
|
||||
|
||||
requestMyHistory(appName) {
|
||||
|
||||
setMaestro(maestroID) {
|
||||
this.maestroID = maestroID;
|
||||
}
|
||||
|
||||
requestRankingHour(appName) {
|
||||
|
||||
setPlayer(userID) {
|
||||
this.playerUserID = userID;
|
||||
}
|
||||
|
||||
requestRankingDay(appName) {
|
||||
|
||||
setAppName(appName) {
|
||||
this.appName = appName;
|
||||
}
|
||||
|
||||
requestRankingMonth(appName) {
|
||||
|
||||
requestMyHistory(listener) {
|
||||
let historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
listener(historyRecordManager);
|
||||
}
|
||||
|
||||
requestRankingHour(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestRankingDay(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestRankingMonth(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestAllRankingHour(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestAllRankingDay(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestAllRankingMonth(listener) {
|
||||
this.requestRanking(type, listener);
|
||||
}
|
||||
|
||||
requestRanking(type, listener) {
|
||||
let rankingRecordManager = new RankingRecordManager();
|
||||
|
||||
listener(rankingRecordManager);
|
||||
}
|
||||
|
||||
|
||||
requestTempMyHistory() {
|
||||
this.historyRecordManager.clear();
|
||||
requestTempMyHistory(listener) {
|
||||
let historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/10", 15460));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/11", 3040));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/12", 460));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/13", 60));
|
||||
this.historyRecordManager.push(new HistoryRecordData("05/14", 8));
|
||||
historyRecordManager.push(new HistoryRecord("05/10", "space_invaders", 15460));
|
||||
historyRecordManager.push(new HistoryRecord("05/11", "typing_korean_basic", 3040));
|
||||
historyRecordManager.push(new HistoryRecord("05/12", "typing_english_basic", 460));
|
||||
historyRecordManager.push(new HistoryRecord("05/13", "space_invaders", 60));
|
||||
historyRecordManager.push(new HistoryRecord("05/14", "space_invaders", 8));
|
||||
|
||||
this.printHistoryRecords();
|
||||
if(listener === null)
|
||||
return;
|
||||
|
||||
listener(historyRecordManager);
|
||||
}
|
||||
|
||||
requestTempRanking() {
|
||||
requestTempRanking(userID, appName, rankingRecordManager, listener) {
|
||||
let jsonRankingList = [
|
||||
{ "UserID":"17", "Name":"강경모", "BestRecord":"4400" },
|
||||
{ "UserID":"2", "Name":"강성태", "BestRecord":"3400" },
|
||||
@@ -52,7 +90,10 @@ class DBConnectManager {
|
||||
{ "UserID":"16", "Name":"하하하", "BestRecord":"4" },
|
||||
];
|
||||
|
||||
return jsonRankingList;
|
||||
if(listener === null)
|
||||
return;
|
||||
|
||||
listener();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user