namespace Recordingtest.Bridge; /// /// Generic, SUT-neutral abstraction for reading the current engine state of /// a WPF application under test. Implementations may delegate to a SUT-side /// in-process bridge (HmEG-aware tier), to a reflection probe, or to a stub. /// /// This interface lives in Recordingtest.Bridge.Abstractions so that /// every higher tier (HmEG-aware / app-specific) can target it without the /// generic core ever seeing a SUT-specific symbol. /// public interface IEngineStateProvider { IReadOnlyList GetSelectedIds(); CameraSnapshot GetCamera(); SceneSnapshot GetScene(); bool GetRenderComplete(); /// /// Restore the camera state in the live SUT. Best-effort: implementations /// that cannot write the camera (reflection fallback, null provider) must /// swallow any exception and return silently. /// void SetCamera(CameraSnapshot snapshot); } public sealed record CameraSnapshot(double[] Eye, double[] Target, double[] Up, double Fov); public sealed record SceneSnapshot(int ObjectCount, string? DocumentPath); /// /// Safe-default provider used when no real SUT bridge is available /// (CI / unit tests / startup race window). /// public sealed class NullEngineStateProvider : IEngineStateProvider { public IReadOnlyList GetSelectedIds() => Array.Empty(); public CameraSnapshot GetCamera() => new( new double[] { 0, 0, 0 }, new double[] { 0, 0, 0 }, new double[] { 0, 0, 1 }, 45.0); public SceneSnapshot GetScene() => new(0, null); public bool GetRenderComplete() => true; public void SetCamera(CameraSnapshot snapshot) { /* no-op */ } }