Merge remote-tracking branch 'origin/sub_laptop_4' into main_laptop_1

This commit is contained in:
2026-10-17 13:18:03 +09:00
3 changed files with 10 additions and 5 deletions
@@ -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;
+7 -4
View File
@@ -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,
};
// ③ 고름 — 제목 · ▲▼↺ · ◀▶ 막음 · ▲▼ = 암만(종단으로 안 샘)
+1 -1
View File
@@ -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: