fix(review-batch3): 类型收紧生产清零137处(P1-2三步+延伸)+autoload class_name(ConfigDb/RngServiceCore)与_init标注(P2-1)+validate_skill_pool_links/ShopTable标注(P2-4)+相位enum外String面(P2-2)+typed-rows探针实证.tres装载转换;smoke缝合20处rows.assign+str(bb)同语义;审计生产双归零(240→103/83→59全测试链),单测7套绿,冒烟576/0同基线

This commit is contained in:
DKChan committed 2026-09-29 07:01:29 +08:00
1 parent f5edb65d25
commit 104cea6461
46 files changed
+233 -218

No files matched your search

+13 -13
View File
@@ -40,9 +40,9 @@ signal board_changed()
signal level_finished(payload: Dictionary) # {result, hp, node_index, node_id, node_type}
signal wallet_changed(event: String, gp: int, extra: Dictionary) # GP 钱包事件投影:gain{amount}/buy{product,price}/clear——试玩日志与商店覆盖层刷新源(GP+商店房实施批)
var db
var rng
var level_row: Dictionary = {}
var db: ConfigDb
var rng: RngServiceCore
var level_row: Dictionary[String, Variant] = {}
var node_index := -1
# ---- 账本载体(冒险结构实现批——漂移②清偿)----
# 冒险模式 = AdventureRunner 共享字典(Dictionary 引用共享——hero_hp/gp 属性读写直接落冒险账本);
@@ -68,12 +68,12 @@ var hero_hp_pct := 0
var _running := false
var level_result := "" # "" / "victory" / "defeat"
var _awaiting_choice := false # 选路态(兑付确认后、pick 前为零自动推进的可见停点)
var _candidates: Array = [] # 当前选路候选(节点引用数组)
var visited: Array = [] # 已兑付/到达节点序列(呈现层图条数据源;含当前节点)
var _candidates: Array[Dictionary] = [] # 当前选路候选(节点引用数组)
var visited: Array[Dictionary] = [] # 已兑付/到达节点序列(呈现层图条数据源;含当前节点)
var _graph_mode := false # 图形态缓存(行集任一节点带 next;单链 = false)
func _init(db_ref, rng_ref) -> void:
func _init(db_ref: ConfigDb, rng_ref: RngServiceCore) -> void:
db = db_ref
rng = rng_ref
@@ -142,7 +142,7 @@ func start_level(level_index: int, seed_val: int, base_override_in: Dictionary =
break
hero_hp = effective_max_hp()
rng.new_adventure(seed_val) # 关卡起点 = 冒险起点(切片口径;跨关接续归 冒险结构)
level_row = _resolve_template_row(row, template_pick) # 池解析在播种后(node_map 抽签须已播种——EC7)
level_row.assign(_resolve_template_row(row, template_pick)) # 池解析在播种后(node_map 抽签须已播种——EC7)
_running = true
var entry := _entry_node()
if entry.is_empty():
@@ -177,7 +177,7 @@ func start_level_external(level_index: int, ledger: Dictionary, bonus_ref: Dicti
base_override = base_override_ref
_shop_purchased = purchased_ref
_rest_handler = rest_handler
level_row = _resolve_template_row(row, template_pick)
level_row.assign(_resolve_template_row(row, template_pick))
node_index = -1
level_result = ""
_awaiting_choice = false
@@ -286,11 +286,11 @@ func _out_ids(node: Dictionary) -> Array:
# 出边候选(节点引用数组——选路口/呈现层共用读面)
func _out_nodes(node: Dictionary) -> Array:
func _out_nodes(node: Dictionary) -> Array[Dictionary]:
var ids := {}
for n in nodes():
ids[_node_id(n)] = n
var out: Array = []
var out: Array[Dictionary] = []
for tid in _out_ids(node):
if ids.has(tid):
out.append(ids[tid])
@@ -304,7 +304,7 @@ func next_candidates() -> Array:
# 当前选路候选编号表(pick_next_node 的合法入参域——编号空间解析单一出口)
func next_candidate_ids() -> Array:
var out: Array = []
var out: Array[int] = []
for c in _candidates:
out.append(_node_id(c))
return out
@@ -326,7 +326,7 @@ func node_out_ids(node: Dictionary) -> Array:
# 已到节点编号序列(只读投影——编号空间解析单一出口)
func visited_ids() -> Array:
var out: Array = []
var out: Array[int] = []
for v in visited:
out.append(_node_id(v))
return out
@@ -493,7 +493,7 @@ func close_wallet() -> void:
# 商店覆盖层数据源(只读投影——现价/已购档数在此现算,呈现层禁复算定价公式)
func shop_products() -> Array:
var out: Array = []
var out: Array[Dictionary] = []
for prow in db.shop_products():
out.append({
"product_id": String(prow.get("product_id", "")),