Fix: restructing session manager, ES6 -> ES5
This commit is contained in:
@@ -1,77 +1,69 @@
|
||||
class AppInfo {
|
||||
|
||||
constructor(appID, appName, koreanName, howToPlay) {
|
||||
this.appID = appID;
|
||||
this.appName = appName;
|
||||
|
||||
this.koreanName = koreanName;
|
||||
this.isActivated = false;
|
||||
this.howToPlay = howToPlay;
|
||||
}
|
||||
function AppInfo(appID, appName, koreanName, howToPlay) {
|
||||
this.appID = appID;
|
||||
this.appName = appName;
|
||||
|
||||
this.koreanName = koreanName;
|
||||
this.isActivated = false;
|
||||
this.howToPlay = howToPlay;
|
||||
}
|
||||
|
||||
|
||||
class AppInfoManager {
|
||||
function AppInfoManager() {
|
||||
this.appInfoMap = new Map();
|
||||
|
||||
constructor() {
|
||||
this.appInfoMap = new Map();
|
||||
this.registerAppInfoList();
|
||||
}
|
||||
|
||||
this.registerAppInfoList();
|
||||
}
|
||||
AppInfoManager.prototype.registerAppInfoList = function() {
|
||||
// menu
|
||||
this.registerAppInfo(new AppInfo("test", "테스트", ""));
|
||||
this.registerAppInfo(new AppInfo("login", "로그인", ""));
|
||||
this.registerAppInfo(new AppInfo("menu", "메뉴", ""));
|
||||
|
||||
registerAppInfoList() {
|
||||
// menu
|
||||
this.registerAppInfo(new AppInfo("test", "테스트", ""));
|
||||
this.registerAppInfo(new AppInfo("login", "로그인", ""));
|
||||
this.registerAppInfo(new AppInfo("menu", "메뉴", ""));
|
||||
// typing
|
||||
this.registerAppInfo(new AppInfo("korean_basic", "기본 자리", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_upper", "왼손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_second_finger", "검지 글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_upper", "오른손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_lower", "왼손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_lower", "오른손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_upper_double", "쌍자음", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_upper_double", "쌍모음", ""));
|
||||
|
||||
// typing
|
||||
this.registerAppInfo(new AppInfo("korean_basic", "기본 자리", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_upper", "왼손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_second_finger", "검지 글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_upper", "오른손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_lower", "왼손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_lower", "오른손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_left_upper_double", "쌍자음", ""));
|
||||
this.registerAppInfo(new AppInfo("korean_right_upper_double", "쌍모음", ""));
|
||||
this.registerAppInfo(new AppInfo("english_basic", "기본 자리", ""));
|
||||
this.registerAppInfo(new AppInfo("english_left_upper", "왼손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_second_finger", "검지 글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_right_upper", "오른손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_left_lower", "왼손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_right_lower", "오른손 밑글쇠", ""));
|
||||
|
||||
this.registerAppInfo(new AppInfo("english_basic", "기본 자리", ""));
|
||||
this.registerAppInfo(new AppInfo("english_left_upper", "왼손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_second_finger", "검지 글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_right_upper", "오른손 윗글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_left_lower", "왼손 밑글쇠", ""));
|
||||
this.registerAppInfo(new AppInfo("english_right_lower", "오른손 밑글쇠", ""));
|
||||
// mouse
|
||||
this.registerAppInfo(new AppInfo("space_invaders", "외계인 침공",
|
||||
"외계인이 나타났다!\n마우스 왼쪽 버튼으로\n외계인을 클릭해서 물리쳐 주세요."
|
||||
));
|
||||
this.registerAppInfo(new AppInfo("card_matching", "카드 짝 맞추기",
|
||||
"외계인이 나타났다 사라집니다.\n\n마우스 왼쪽 버튼으로 외계인을 클릭해서\n\n물리쳐 주세요."
|
||||
));
|
||||
}
|
||||
|
||||
// mouse
|
||||
this.registerAppInfo(new AppInfo("space_invaders", "외계인 침공",
|
||||
"외계인이 나타났다!\n마우스 왼쪽 버튼으로\n외계인을 클릭해서 물리쳐 주세요."
|
||||
));
|
||||
this.registerAppInfo(new AppInfo("card_matching", "카드 짝 맞추기",
|
||||
"외계인이 나타났다 사라집니다.\n\n마우스 왼쪽 버튼으로 외계인을 클릭해서\n\n물리쳐 주세요."
|
||||
));
|
||||
}
|
||||
AppInfoManager.prototype.setHowToPlay = function(appName, text) {
|
||||
this.appInfoMap[appName].howToPlay = text;
|
||||
}
|
||||
|
||||
setHowToPlay(appName, text) {
|
||||
this.appInfoMap[appName].howToPlay = text;
|
||||
}
|
||||
AppInfoManager.prototype.registerAppInfo = function(appInfo) {
|
||||
return this.appInfoMap[appInfo.appName] = appInfo;
|
||||
}
|
||||
|
||||
registerAppInfo(appInfo) {
|
||||
return this.appInfoMap[appInfo.appName] = appInfo;
|
||||
}
|
||||
AppInfoManager.prototype.getAppkoreanName = function(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
|
||||
getAppkoreanName(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
return this.appInfoMap[appName].koreanName;
|
||||
}
|
||||
|
||||
return this.appInfoMap[appName].koreanName;
|
||||
}
|
||||
|
||||
getHowToPlayText(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
|
||||
return this.appInfoMap[appName].howToPlay;
|
||||
}
|
||||
AppInfoManager.prototype.getHowToPlayText = function(appName) {
|
||||
if(appName === null)
|
||||
return "";
|
||||
|
||||
return this.appInfoMap[appName].howToPlay;
|
||||
}
|
||||
Reference in New Issue
Block a user