using System.Threading;
namespace Editor;
public abstract class EditorSystem
{
///
/// The scene we're currently editing
///
public abstract Scene Scene { get; }
///
/// Run a process on multiple items, show progress bar
///
public abstract Task ForEachAsync( IEnumerable list, string title, Func worker, CancellationToken cancel = default, bool modal = false );
///
/// Start a progress section
///
public abstract IProgressSection ProgressSection( bool modal = false );
///
/// The main editor camera
///
public abstract CameraComponent Camera { get; }
}
public interface IProgressSection : IDisposable
{
public string Icon { get; set; }
public string Title { get; set; }
public string Subtitle { get; set; }
public double Current { get; set; }
public double TotalCount { get; set; }
public double ProgressDelta => (TotalCount > 0 ? Current / TotalCount : 0).Clamp( 0, 1 );
public void Cancel();
public CancellationToken GetCancel();
}