namespace AcDream.App.Rendering; internal interface IRenderWeatherFramePhase { void Tick(double deltaSeconds); } /// /// Preserves the accepted pre-world order after the GPU/resource transaction: /// begin optional developer UI, advance render-time weather, then hand the /// completed preparation to the world phase. /// internal sealed class RenderFramePreparationController : IRenderFrameResourcePhase { private readonly IRenderFrameResourcePhase _resources; private readonly IDevToolsFrameLifecycle? _devTools; private readonly IRenderWeatherFramePhase _weather; public RenderFramePreparationController( IRenderFrameResourcePhase resources, IDevToolsFrameLifecycle? devTools, IRenderWeatherFramePhase weather) { _resources = resources ?? throw new ArgumentNullException(nameof(resources)); _devTools = devTools; _weather = weather ?? throw new ArgumentNullException(nameof(weather)); } public void Prepare(RenderFrameInput input) { _resources.Prepare(input); _devTools?.BeginFrame((float)input.DeltaSeconds); _weather.Tick(input.DeltaSeconds); } }