32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace TKS.OutGame
|
|
{
|
|
/// <summary>내정 순찰(patrol.csv · 기획서 §7) — 마지막 클리어 챕터별 시간당 골드 · 병사 경험 · 승급 장비 등급 · 청동 상자 수.</summary>
|
|
public class PatrolTable : ScriptableObject
|
|
{
|
|
[Serializable]
|
|
public class Row
|
|
{
|
|
public int chapter;
|
|
public int goldPerHour;
|
|
public int expPerHour;
|
|
public string gearGrade;
|
|
public float chestPerHour;
|
|
}
|
|
|
|
public List<Row> rows = new List<Row>();
|
|
|
|
/// <summary>챕터 no 의 행(없으면 가장 가까운 아래 챕터 · 그것도 없으면 첫 행).</summary>
|
|
public Row For(int chapter)
|
|
{
|
|
Row best = null;
|
|
foreach (var r in rows)
|
|
if (r.chapter <= chapter && (best == null || r.chapter > best.chapter)) best = r;
|
|
return best ?? (rows.Count > 0 ? rows[0] : null);
|
|
}
|
|
}
|
|
}
|