Files
gplan-2/game/core/settlement/decay_segment.gd
T
2026-11-04 05:08:31 +08:00

23 lines
1.1 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
class_name DecaySegment
extends RefCounted
# ④ 衰减段 Segment(P1-1 结算巨函数拆段;段边界=审计五段〔裁点③甲〕)。
# 职责:状态衰减恰一次恒执行含末轮——先兑付后衰减。
# 耦合边界(5.1 封装修复换代):引用束注入——构造收编排器组装的 20 键封闭束,本段断言 2 键
# (status_effects/emit_row_cb)解包同名成员;行发射经 emit_row_cb 回宿主——对编排器零引用。
# 零算法改动(🔴 零行为变更契约)。
var status_effects: StatusContainer # 状态容器(衰减推进面)
var emit_row_cb: Callable # 宿主 _emit_row——行协议面单点(5 参 head 束形)
func _init(bundle: Dictionary) -> void:
for k in ["status_effects", "emit_row_cb"]:
assert(bundle.has(k), "[衰减段] 引用束缺键: %s" % k)
status_effects = bundle.status_effects
emit_row_cb = bundle.emit_row_cb
func run(ri: int) -> void:
var k: int = status_effects.decay_round()
emit_row_cb.call({"type": "decay", "source_class": "", "origin_cell": Vector2i(-1, -1)}, ri, "状态衰减", k, {})