Add: RecordUtil

This commit is contained in:
2018-12-03 00:25:16 +09:00
parent 057ac18184
commit eb61871526
12 changed files with 92 additions and 270 deletions
+25
View File
@@ -0,0 +1,25 @@
function RecordUtil() {
}
RecordUtil.getRecordValueWithUnit = function(record, appID) {
var recordValue = RecordUtil.getRecordValueText(record, appID);
var recordUnit = RecordUtil.getRecordUnit(appID);
return recordValue + recordUnit;
}
RecordUtil.getRecordValueText = function(record, appID) {
if(appID == 104)
return record.toFixed(2);
else
NumberUtil.numberWithCommas(Math.floor(record));
}
RecordUtil.getRecordUnit = function(appID) {
if(appID == 104)
return " 초";
else if(appID < 100)
return " 타";
else
return " 점";
}
+4 -3
View File
@@ -63,9 +63,10 @@ ScreenBottomUI.prototype.printText = function(textObject, text, align) {
}
ScreenBottomUI.prototype.printLeftTextWithAppHighestRecord = function(bestRecord) {
var roundUpBestRecord = Math.round(bestRecord);
var highScoreWithCommas = NumberUtil.numberWithCommas(roundUpBestRecord);
this.printLeftText("최고 기록 : " + highScoreWithCommas);
this.printLeftText(
"최고 기록 : "
+ RecordUtil.getRecordValueWithUnit(bestRecord, sessionStorageManager.getPlayingAppID())
);
}
ScreenBottomUI.prototype.getFontStyle = function() {