using System; namespace UnityEditor.U2D.Tooling.Analyzer { /// /// Interface for report data sources that can capture, analyze, and provide data for analyzer reports. /// Implementations of this interface handle the collection and management of specific types of data /// used by analyzer reports, such as asset information, performance metrics, or project statistics. /// public interface IReportDataSource { /// /// Starts capturing data from the specified asset search paths. /// This method initiates the data collection process and may run asynchronously. /// /// Array of asset paths to search and capture data from. void Capture(string[] assetSearchPath); /// /// Stops the current data capture operation if one is in progress. /// This method should gracefully halt any ongoing capture processes. /// void StopCapture(); /// /// Event raised when the data source's underlying data has changed. /// Subscribers can use this to update their reports or UI when new data becomes available. /// event Action onDataSourceChanged; /// /// Event raised when a data capture operation begins. /// This allows subscribers to respond to the start of data collection, such as showing progress indicators. /// event Action onCaptureStart; /// /// Event raised when a data capture operation completes. /// This signals that the capture process has finished, either successfully or due to cancellation. /// event Action onCaptureEnd; /// /// Gets a value indicating whether a data capture operation is currently in progress. /// bool capturing { get; } /// /// Performs cleanup operations and releases any resources used by the data source. /// This method should be called when the data source is no longer needed. /// void Dispose(); /// /// Saves the current data source state to the specified save file. /// This allows the data source's captured data to be persisted for later use. /// /// The save file interface to write data to. void Save(ISaveFile saveData); /// /// Loads previously saved data source state from the specified save file. /// This restores the data source to a previously captured state without needing to recapture. /// /// The save file interface to read data from. void Load(ISaveFile saveData); /// /// Gets the human-readable name of this data source. /// This name is typically used for display purposes in the UI and for identification. /// public string name { get; } /// /// Gets the last time the data source captured data. /// public long lastCaptureTime { get; } } }