Files
core/hwe/ts/utilGame/formatDefenceTrain.ts
T
Hide_D a95b26551c 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
2022-04-08 02:28:58 +09:00

17 lines
406 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import bs from 'binary-search';
const defenceMap: [number,string][] = [
[0, "△"],
[60, "○"],
[80, "◎"],
[90, "☆"],
[999, "×"],
]
export function formatDefenceTrain(defenceTrain: number): string {
const idx = bs(defenceMap, defenceTrain, ([defenceKey], needle) => defenceKey - needle);
if(idx >= 0){
return defenceMap[idx][1]??'?';
}
return defenceMap[-(idx + 1)][1]??'?';
}