using UnityEngine;
namespace Colosseum.Combat.Simulation
{
///
/// 허수아비 계산 시뮬레이터의 회전 규칙입니다.
///
[System.Serializable]
public class RotationPolicy
{
[Header("Label")]
[SerializeField] private string policyName = "기본 우선순위";
[Header("Priority")]
[Tooltip("앞에서부터 우선 적용할 슬롯 순서입니다. 0 기반 인덱스를 사용합니다.")]
[SerializeField] private int[] prioritySlots = new[] { 0, 1, 2, 3, 4, 5 };
[Header("Fallback")]
[SerializeField] private bool useFallbackSlot = true;
[Min(0)] [SerializeField] private int fallbackSlotIndex = 0;
[Header("High Power Skill")]
[SerializeField] private bool delayHighPowerSkillUntilTime;
[Min(0)] [SerializeField] private int highPowerSlotIndex = 5;
[Min(0f)] [SerializeField] private float highPowerFirstUseTime = 0f;
public string PolicyName => string.IsNullOrWhiteSpace(policyName) ? "Rotation" : policyName.Trim();
public int[] PrioritySlots => prioritySlots ?? System.Array.Empty();
public bool UseFallbackSlot => useFallbackSlot;
public int FallbackSlotIndex => Mathf.Max(0, fallbackSlotIndex);
public bool DelayHighPowerSkillUntilTime => delayHighPowerSkillUntilTime;
public int HighPowerSlotIndex => Mathf.Max(0, highPowerSlotIndex);
public float HighPowerFirstUseTime => Mathf.Max(0f, highPowerFirstUseTime);
///
/// 회전 정책 값을 한 번에 설정합니다.
///
public void Configure(
string policyName,
int[] prioritySlots,
bool useFallbackSlot,
int fallbackSlotIndex,
bool delayHighPowerSkillUntilTime,
int highPowerSlotIndex,
float highPowerFirstUseTime)
{
this.policyName = policyName ?? string.Empty;
this.prioritySlots = prioritySlots ?? System.Array.Empty();
this.useFallbackSlot = useFallbackSlot;
this.fallbackSlotIndex = Mathf.Max(0, fallbackSlotIndex);
this.delayHighPowerSkillUntilTime = delayHighPowerSkillUntilTime;
this.highPowerSlotIndex = Mathf.Max(0, highPowerSlotIndex);
this.highPowerFirstUseTime = Mathf.Max(0f, highPowerFirstUseTime);
}
}
}