rabidus-test/Assets/Plugins/QFSW/Quantum Console/Source/Scripts/Actions/WaitWhile.cs

25 lines
610 B
C#
Raw Normal View History

2023-08-22 15:41:12 +03:00
using System;
namespace QFSW.QC.Actions
{
/// <summary>
/// Waits while the given condition is met.
/// </summary>
public class WaitWhile : ICommandAction
{
private readonly Func<bool> _condition;
public bool IsFinished => _condition();
public bool StartsIdle => true;
/// <param name="condition">The condition to wait on.</param>
public WaitWhile(Func<bool> condition)
{
_condition = condition;
}
public void Start(ActionContext context) { }
public void Finalize(ActionContext context) { }
}
}