Files
spellforge/scripts/domain/spell_system/compiled_deck.gd
T
2026-07-20 10:56:52 +08:00

22 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.
## CompiledDeck — 预编译产物,关卡期间只读
## 权威来源:implementation_plan.md §2.2
extends RefCounted
class_name CompiledDeck
var nodes: Array = [] # Array[SpellNode] 拓扑扁平化 + SCOPE 虚节点插入
var label_table: Dictionary = {} # { label_id: int → node_index: int }LOGIC_LABEL 专用)
var sub_payload_ids: Array = [] # 本 Deck 预编译时注册到 SubPayloadRegistry 的所有 ID
var topology_type: int = 0 # 0=LINEAR 1=MATRIX 2=CIRCUIT
var feature_tags: int = 0 # Core 特性位掩码快照(CoreFeatureTag.*),供执行期判断 PERSISTENT_MEMORY 等
var consumed_indices: Array = [] # 共鸣 consume_inputs 消费的 nodes 索引(P6-N29),运行时跳过
var checksum: int = 0 # 插槽内容哈希判断是否需要重新编译
## 创建用于执行的 SpellDeck 实例(拷贝 nodes 并重置 cursor
func make_runtime_deck() -> SpellDeck:
var deck := SpellDeck.new()
deck.setup(nodes.duplicate(), consumed_indices)
return deck
func is_empty() -> bool:
return nodes.is_empty()