using System;
using System.Collections.Generic;
using UnityEngine;
namespace TKS.OutGame
{
/// 승급 장비 12 종 × 5 등급(gear_items.csv). 등급 순서(order) = 합성 사슬 깊이(craft_from 없는 흰 = 1).
public class GearDb : ScriptableObject
{
[Serializable]
public class Item
{
public string id;
public string nameKo;
public string kind;
[Tooltip("white|green|blue|purple|orange")]
public string grade;
[Tooltip("등급 순서 1~ (합성 사슬 깊이)")]
public int order;
public int sellGold;
public int dropFromChapter;
public string craftFrom;
public int craftCount;
public int craftBlueprint;
}
public List- items = new List
- ();
Dictionary index;
public Item Get(string id)
{
if (string.IsNullOrEmpty(id)) return null;
if (index == null || index.Count != items.Count)
{
index = new Dictionary();
foreach (var i in items) index[i.id] = i;
}
Item res;
return index.TryGetValue(id, out res) ? res : null;
}
public void InvalidateIndex()
{
index = null;
}
/// 등급 id → 순서(없으면 0).
public int OrderOf(string grade)
{
foreach (var i in items)
if (i.grade == grade) return i.order;
return 0;
}
}
}