mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2026-08-15 15:07:48 +04:00
25 lines
430 B
C#
25 lines
430 B
C#
namespace NResUI;
|
|
|
|
public interface ILater
|
|
{
|
|
void Execute(Action action);
|
|
}
|
|
|
|
public class Later : ILater
|
|
{
|
|
private Queue<Action> _queue = new();
|
|
|
|
public void Execute(Action action)
|
|
{
|
|
_queue.Enqueue(action);
|
|
}
|
|
|
|
public IEnumerable<Action> Enumerate()
|
|
{
|
|
while (_queue.Count > 0)
|
|
{
|
|
var action = _queue.Dequeue();
|
|
yield return action;
|
|
}
|
|
}
|
|
} |