From fa0f175baef23189f653712d469dbdfb4b62ab8e4ae37dea4a463d83d9009dc6 Mon Sep 17 00:00:00 2001 From: copecone Date: Mon, 17 Aug 2026 21:17:15 +0900 Subject: [PATCH] Create `RenderSession` --- API/RenderSession.cs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/API/RenderSession.cs b/API/RenderSession.cs index 95e4d91..2399faa 100644 --- a/API/RenderSession.cs +++ b/API/RenderSession.cs @@ -1,12 +1,13 @@ using System; using ADOFAIRenderer.Core; +using ADOFAIRenderer.Data; namespace ADOFAIRenderer.API; /// /// Fluent builder for configuring and starting a render session. /// -public class RenderSessionBuilder +public class RenderSession { private bool _auto = true; @@ -18,14 +19,14 @@ public class RenderSessionBuilder /// Sets whether automatic rendering is enabled. /// /// true to enable automatic rendering; otherwise, false. Default is true. - /// The current instance for method chaining. - public RenderSessionBuilder WithAuto(bool enabled = true) + /// The current instance for method chaining. + public RenderSession WithAuto(bool enabled = true) { _auto = enabled; return this; } - public RenderSessionBuilder WithPatch(PatchType patchType, bool enabled = true) + public RenderSession WithPatch(PatchType patchType, bool enabled = true) { switch (patchType) { @@ -40,10 +41,16 @@ public class RenderSessionBuilder /// /// Applies the configured flags and initiates the render session. /// - public void Start() + public void Start(RenderConfig renderConfig, string levelPath) { - RenderFlags.Auto = _auto; - RenderFlags.TimePatch = _timePatch; - RenderFlags.ScreenPatch = _screenPatch; + RenderContext.Auto = _auto; + RenderContext.TimePatch = _timePatch; + RenderContext.ScreenPatch = _screenPatch; + + RenderManager.Instance.levelPath = levelPath; + RenderManager.Instance.Configuration = renderConfig; + + RenderManager.Instance.SetupCaptureDirectory(); + RenderManager.Instance.SetupGameScene(); } } \ No newline at end of file