## CoreDefinition — 法杖 Core 插槽定义
## 权威来源：architecture_design.md §3.1, core_wand_design.md
extends Resource
class_name CoreDefinition

enum Topology {
	LINEAR  = 0,
	MATRIX  = 1,
	CIRCUIT = 2,
}

@export var id:           String  = ""
@export var display_name: String  = ""
@export var slot_count:   int     = 5     # LINEAR 局线插槽数
var topology:    int     = Topology.LINEAR
@export var cpu_limit:    int     = 5     # cpu_limit * MAX_OPS_PER_CPU = 单次最大执行步数
@export var cast_interval: float  = 0.5  # 默认施法间隔（秒）

## MATRIX 专用：行数 × 列数
@export var grid_rows:    int     = 1
@export var grid_cols:    int     = 5

## CIRCUIT 专用：有向边列表（P6-N42 权威格式 Array[Dictionary]：{ "from": int, "to": int }）
## _flatten_circuit() 从此处读取做 Kahn 拓扑排序；LINEAR/MATRIX 留空。也兼容 [from, to] 数组对。
@export var edges:        Array   = []

## CoreFeatureTag 位掉：PERSISTENT_MEMORY=1, DUAL_STREAM=2, 等
@export var feature_tags: int     = 0

## 魔力池（MVP）——由 WandPreset 从 cores.json 读入
@export var base_mana_max:   float = 100.0
@export var base_mana_regen: float = 5.0    # 每秒回复
@export var base_mana_leech: float = 0.0    # 击杀回蓝基础值（可叠加卡组内 meta.mana_leech）
