EerieVillage/Assets/Scripts/Progression/SkillCardPlaceholderPool.cs

32 lines
1.1 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace EerieVillage.Progression
{
/// <summary>
/// BT12-MVP-A 영역 placeholder 카드 풀. Inspector 영역 SkillCardPlaceholder 5~8장 등록.
/// 차기 BT12-Dev 본격 영역 = SkillRuntimeFactory 영역 활용.
/// </summary>
public class SkillCardPlaceholderPool : MonoBehaviour
{
[SerializeField] List<SkillCardPlaceholder> _allCards = new List<SkillCardPlaceholder>();
public IReadOnlyList<SkillCardPlaceholder> AllCards => _allCards;
/// <summary>5~8장에서 무작위 3장 추출 (중복 X). 카드 영역 부족 시 가능 영역만.</summary>
public List<SkillCardPlaceholder> Draw3Random()
{
var copy = new List<SkillCardPlaceholder>(_allCards);
var result = new List<SkillCardPlaceholder>();
int draw = Mathf.Min(3, copy.Count);
for (int i = 0; i < draw; i++)
{
int idx = Random.Range(0, copy.Count);
result.Add(copy[idx]);
copy.RemoveAt(idx);
}
return result;
}
}
}