feat: 통합 세력 장수/암행부 페이지 (#213)
- ag-grid 기반 - 컬럼 사용자 정의 기능 제공 - 컬럼 재정렬, 고정, 정렬 기능 - 컬럼 상태 저장, 불러오기 - 마지막 컬럼 재 사용 - 아이콘, 장수명 클릭 시 특수 기능 제공 - 기본 세력 장수/암행부에서는 '감찰부' - 추가 컬럼 - 최근 전투 - 전투 수 - 승리 수 - 살상률 - API/Nation/GeneralList 추가 Co-authored-by: hide_d <hided62@gmail.com> Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/213
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import bs from 'binary-search';
|
||||
|
||||
const hornorMap: [number, string][] = [
|
||||
[0, '전무'],
|
||||
[640, '무명'],
|
||||
[2560, '신동'],
|
||||
[5760, '약간'],
|
||||
[10240, '평범'],
|
||||
[16000, '지역적'],
|
||||
[23040, '전국적'],
|
||||
[31360, '세계적'],
|
||||
[40960, '유명'],
|
||||
[45000, '명사'],
|
||||
[51840, '호걸'],
|
||||
[55000, '효웅'],
|
||||
[64000, '영웅'],
|
||||
[77440, '구세주'],
|
||||
]
|
||||
|
||||
export function formatHonor(experience: number): string {
|
||||
const idx = bs(hornorMap, experience, ([experienceKey], needle) => experienceKey - needle);
|
||||
if (idx >= 0) {
|
||||
return hornorMap[idx][1] ?? '?';
|
||||
}
|
||||
return hornorMap[-(idx + 1)][1] ?? '?';
|
||||
}
|
||||
Reference in New Issue
Block a user