전투 시뮬레이터 기본 기능 구현 완료

This commit is contained in:
2018-08-27 02:21:45 +09:00
parent 6b4a7ee03b
commit ef1f2722fc
4 changed files with 122 additions and 8 deletions
+13
View File
@@ -23,6 +23,14 @@ var escapeHtml = (function (string) {
}
})();
/**
* 변수가 정수인지 확인하는 함수
* @param {*} n 정수인지 확인하기 위한 인자
* @return {boolean} 정수인지 여부
*/
function isInt(n) {
return +n === n && !(n % 1);
}
/**
* object의 array를 id를 key로 삼는 object로 재 변환
@@ -89,6 +97,11 @@ function convColorValue(color) {
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
/**
* 단순한 Template 함수. <%변수명%>으로 template 가능
* @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js