迭代46卡C(棋盘格边长口径收口批v2.0): 格边长算式单点化——board_view抽static _cell_for逐位同式(SEP/DEPTH_PX读本文件常量·clampi[26,46]留函数内·S13顶格27/31持平零新增成员)+set_cell_area改调·副作用尾链零动(行为零变化)·探针阈值判据退役(MIN_CELL常量整行删除·阈值断言换等价断言cell==_cell_for(n,bv.size)·_board内部字段直查受控例外=N无公开出口·PASS行含基座实读+13/14推定留痕打印不作判红·零尺寸前置记红)·单元冒烟扩四档板型((L,D)取样10/12/13/14·板型一致+算式单点等价两断言·既有网格高与26-46区间断言逐字保留·62→74checks全绿)·探针两档绿(基座实读40px·13/14推定30/28与卡§2.7锚点逐值一致·全屏46/46·可用面积1022x454/1662x734)·grep MIN_CELL/可读门槛/可读下限全仓零命中·probe_gate默认段绿

This commit is contained in:
DKChan committed 2026-11-01 02:53:31 +08:00
1 parent 5269ed4080
commit e3e206d0f5
3 files changed
+57 -17

No files matched your search

+13 -6
View File
@@ -203,15 +203,11 @@ func set_world_font(f: Font) -> void:
# D 区可用面积(AP 条之外)→ 格边长 = floor((min(宽, 高) − 预留 − (N−1)×格间距) / N)(battle.md 格尺寸公式)
# 公式须补算 (N−1)×2px 网格间距与垂直预留 24px,否则 12×12 板实高溢出可用区 ~6px,下缘被 clip_contents 裁掉。
# 算式唯一落点 = _cell_for(迭代 46 卡C——探针与单元测试共用该静态函数求值,禁复写算式造第二口径)。
func set_cell_area(avail: Vector2) -> void:
if _board == null or _board.width == 0:
return
var n: int = maxi(_board.width, _board.height)
var sep := SEP # 格间距(_init 同值)
var d := DEPTH_PX
var reserve := 24.0 + d # 垂直总预留(上 12 + 下 12 + 悬崖外延——悬崖占预算防溢出)
var cell := int(floor((minf(avail.x - 12.0 - d, avail.y - reserve) - float((n - 1) * sep)) / float(n)))
_cell = float(clampi(cell, 26, 46))
_cell = float(_cell_for(maxi(_board.width, _board.height), avail))
_hero_sprite.set_cell_size(_cell, float(SEP))
var stride := _cell + float(SEP)
for c in _cells:
@@ -224,6 +220,17 @@ func set_cell_area(avail: Vector2) -> void:
_update_world_size()
# 格边长算式唯一落点(迭代 46 卡C T1 自 set_cell_area 抽出——逐位同式:SEP/DEPTH_PX 读本文件
# 既有常量、clampi [26,46] 留本函数内;名字带下划线是 S13 max-public-methods 27 顶格的约束,禁改公开名。
# 探针(非当前板型 13/14×实板可用面积)与单元测试(四档板型)经本函数求值,复写算式即造第二口径)
static func _cell_for(n: int, avail: Vector2) -> int:
var sep := SEP # 格间距(_init 同值)
var d := DEPTH_PX
var reserve := 24.0 + d # 垂直总预留(上 12 + 下 12 + 悬崖外延——悬崖占预算防溢出)
var cell := int(floor((minf(avail.x - 12.0 - d, avail.y - reserve) - float((n - 1) * sep)) / float(n)))
return clampi(cell, 26, 46)
# 悬崖参数下发(网格像素尺寸/步距/列数/材质锚色——BoardWorld._draw 消费)
func _refresh_slab() -> void:
if _board == null or _board.width == 0: