diff --git a/B06_Section/B06_Section_UI_Cross_Design_Pick.ts b/B06_Section/B06_Section_UI_Cross_Design_Pick.ts index a6a4c892d..1a5cf4395 100644 --- a/B06_Section/B06_Section_UI_Cross_Design_Pick.ts +++ b/B06_Section/B06_Section_UI_Cross_Design_Pick.ts @@ -522,6 +522,8 @@ export function attachDesignLinePick(input: { }); layer.insertBefore(hit, firstStructureHit ?? null); }); + // 암 판정 선은 보라 선 판정 아래 — 사면 발치처럼 겹친 자리는 설계선이 먼저 골라짐 + if (rockHit && hits[0] !== rockHit) layer.insertBefore(rockHit, hits[0]); const cell = buildLineCell(); let side: CrossSide | null = null; diff --git a/resources/tester/helper_370_3_rock_cell.cjs b/resources/tester/helper_370_3_rock_cell.cjs index bce0124f2..a89734c7d 100644 --- a/resources/tester/helper_370_3_rock_cell.cjs +++ b/resources/tester/helper_370_3_rock_cell.cjs @@ -47,8 +47,11 @@ class Node { append(...kids) { this.children.push(...kids); } - insertBefore(kid) { - this.children.push(kid); + insertBefore(kid, ref) { + this.children = this.children.filter((k) => k !== kid); + const at = ref ? this.children.indexOf(ref) : -1; + if (at < 0) this.children.push(kid); + else this.children.splice(at, 0, kid); } setAttribute(n, v) { this.attrs[n] = String(v); @@ -238,13 +241,13 @@ const out = {}; // ② 판정 선 — 점선 위 path 하나(끊긴 두 토막 · M 둘) · 보라 선 판정 클래스 · 키 rock { const c = card(); - const index = c.hits.indexOf(c.rockHit); c.rockHit.click(); + const index = c.picks[0]; out.hit = { found: !!c.rockHit, tag: c.rockHit?.tagName, moves: (c.rockHit?.getAttribute("d").match(/M/g) ?? []).length, - last: index === c.hits.length - 1, + below: c.hits.indexOf(c.rockHit) === 0, // 그리는 차례 = 보라 선 판정 아래(겹친 자리는 설계선) picked: c.picks, }; // ③ 고름 — 제목 · ▲▼↺ · ◀▶ 막음 · ▲▼ = 암만(종단으로 안 샘) diff --git a/resources/tester/test_370_3_rock_cell.py b/resources/tester/test_370_3_rock_cell.py index c1e579be8..c67fc3de4 100644 --- a/resources/tester/test_370_3_rock_cell.py +++ b/resources/tester/test_370_3_rock_cell.py @@ -42,7 +42,7 @@ def test_안_고르면_공용_칸은_암_버튼과_값(out: dict) -> None: def test_암_경계선_판정_선(out: dict) -> None: hit = out["hit"] assert hit["found"] and hit["tag"] == "path" and hit["moves"] == 2 # 끊긴 두 토막 한 판정 - assert hit["last"] and hit["picked"] == [3] # 조각 셋 뒤 · 누르면 고름 + assert hit["below"] and hit["picked"] == [3] # 설계선 판정 아래 · 키 차례 = 조각 셋 뒤 def test_암_고름은_위아래만_암_키는_암만(out: dict) -> None: