ProjectDDD/Assets/_DDD/_Scripts/RestaurantState/Customer/SpawnSchedule.cs
2025-08-12 20:46:30 +09:00

44 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using Sirenix.OdinInspector;
namespace DDD
{
[Serializable]
public sealed class SpawnSchedule
{
[ShowInInspector] private readonly Queue<string> _queue;
public int Count => _queue.Count;
public SpawnSchedule(IEnumerable<string> ids)
{
_queue = new Queue<string>(ids);
}
public bool TryDequeue(out string id)
{
if (_queue.Count == 0)
{
id = null;
return false;
}
id = _queue.Dequeue();
return true;
}
}
public struct SpawnScheduleBuildArgs
{
public IReadOnlyList<string> NormalIds; // Normal 풀의 ValidCustomers
public IReadOnlyList<string> SpecialIds; // Special 풀의 ValidCustomers (없으면 null 또는 빈 목록)
public int NormalQuota; // 한 번의 스케줄에서 뽑아둘 Normal 개수
public int SpecialQuota; // 한 번의 스케줄에서 뽑아둘 Special 개수
public int Seed; // 셔플 시드(재현성 필요 시)
}
public interface ISpawnScheduleBuilder
{
SpawnSchedule Build(SpawnScheduleBuildArgs args);
}
}