등용·장수대상임관 대상의 타국 장수 정보를 Ref 공개 범위로 제한하고 국가색 묶음 복원
- 명령표의 등용·장수대상임관·공통 장수 fallback에서 타국·재야 장수의 금·쌀·병력·훈련·사기·부대·위치 도시를 제외 - Ref exportJSVars 범위(이름·국가·NPC·통/무/지)만 싣고 국가 묶음용 nationId 추가 - 재야 actor에게는 같은 국가 명령 후보를 보내지 않음 - 등용·장수대상임관 후보를 Ref SelectGeneral groupByNation처럼 국가색 머리와 optgroup으로 묶음 - 증여·포상·몰수·부대탈퇴지시·선양 후보에 Ref의 통/무/지 표시 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { test } from 'node:test';
|
||||
import {
|
||||
groupGeneralOptionsByNation,
|
||||
NATION_GROUPED_GENERAL_COMMANDS,
|
||||
} from '../src/components/command/commandGeneralGroups.ts';
|
||||
|
||||
const nations = [
|
||||
{ value: 1, label: '위', color: '#FFD700' },
|
||||
{ value: 2, label: '오', color: '#000080' },
|
||||
];
|
||||
|
||||
void test('groups general options by nation in first-appearance order like Ref SelectGeneral', () => {
|
||||
const groups = groupGeneralOptionsByNation(
|
||||
[
|
||||
{ value: 11, label: '가 (오)', nationId: 2 },
|
||||
{ value: 12, label: '나 (재야)', nationId: 0 },
|
||||
{ value: 13, label: '다 (위)', nationId: 1 },
|
||||
{ value: 14, label: '라 (오)', nationId: 2 },
|
||||
{ value: 15, label: '마 (위)', nationId: 1, npcState: 1 },
|
||||
],
|
||||
nations
|
||||
);
|
||||
assert.deepEqual(
|
||||
groups.map((group) => [group.name, group.color, group.textColor, group.options.map((option) => option.value)]),
|
||||
[
|
||||
['오', '#000080', '#FFFFFF', [11, 14]],
|
||||
['재야', '#000000', '#FFFFFF', [12]],
|
||||
['위', '#FFD700', '#000000', [13, 15]],
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
void test('falls back to the option nation name and the wanderer color for unknown nations', () => {
|
||||
const [group] = groupGeneralOptionsByNation(
|
||||
[{ value: 1, label: '가', nationId: 9, targetNames: { name: '가', nationName: '멸망국' } }],
|
||||
nations
|
||||
);
|
||||
assert.deepEqual([group?.name, group?.color], ['멸망국', '#000000']);
|
||||
assert.deepEqual(groupGeneralOptionsByNation([], nations), []);
|
||||
});
|
||||
|
||||
void test('only Ref groupByNation commands are grouped', () => {
|
||||
assert.deepEqual([...NATION_GROUPED_GENERAL_COMMANDS], ['che_등용', 'che_장수대상임관']);
|
||||
});
|
||||
@@ -8,6 +8,7 @@ void test('nullable troop names receive display-only fallbacks and preserve lead
|
||||
assert.equal(commandTargetDescription('che_발령', base), '탑승 부대 없음\n금 100');
|
||||
assert.equal(commandTargetDescription('che_포상', base), '금 100');
|
||||
assert.equal(commandTargetDescription('che_몰수', base), '금 100');
|
||||
assert.equal(commandTargetDescription('che_선양', base), '금 100');
|
||||
assert.equal(commandTargetDescription('che_증여', { ...base, troopId: 99 }), '금 100 · 탑승 부대 #99');
|
||||
assert.equal(
|
||||
commandTargetDescription('che_증여', {
|
||||
|
||||
Reference in New Issue
Block a user