ThreeKingdomsSlingshot/Assets/Scripts/OutGame/Data/PromotionTable.cs

42 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace TKS.OutGame
{
/// <summary>승급 등급 녹 → 청 → 자 → 주 → 금(promotion.csv · 기획서 §3-4). 스킬 레벨 상한 = order(§5).</summary>
public class PromotionTable : ScriptableObject
{
[Serializable]
public class Row
{
public string grade;
public int order;
public float promoPct;
[Tooltip("비면 최고 등급")]
public string nextGrade;
}
public List<Row> rows = new List<Row>();
public Row Get(string grade)
{
foreach (var r in rows)
if (r.grade == grade) return r;
return null;
}
/// <summary>영웅 초기 등급(order 최소).</summary>
public string FirstGrade
{
get
{
Row best = null;
foreach (var r in rows)
if (best == null || r.order < best.order) best = r;
return best != null ? best.grade : "";
}
}
}
}