Create RenderSession

This commit is contained in:
copecone committed 2026-08-17 21:17:15 +09:00
1 parent ab19a3a777
commit fa0f175bae
1 file changed
+15 -8
+15 -8
View File
@@ -1,12 +1,13 @@
using System; using System;
using ADOFAIRenderer.Core; using ADOFAIRenderer.Core;
using ADOFAIRenderer.Data;
namespace ADOFAIRenderer.API; namespace ADOFAIRenderer.API;
/// <summary> /// <summary>
/// Fluent builder for configuring and starting a render session. /// Fluent builder for configuring and starting a render session.
/// </summary> /// </summary>
public class RenderSessionBuilder public class RenderSession
{ {
private bool _auto = true; private bool _auto = true;
@@ -18,14 +19,14 @@ public class RenderSessionBuilder
/// Sets whether automatic rendering is enabled. /// Sets whether automatic rendering is enabled.
/// </summary> /// </summary>
/// <param name="enabled"><c>true</c> to enable automatic rendering; otherwise, <c>false</c>. Default is <c>true</c>.</param> /// <param name="enabled"><c>true</c> to enable automatic rendering; otherwise, <c>false</c>. Default is <c>true</c>.</param>
/// <returns>The current <see cref="RenderSessionBuilder"/> instance for method chaining.</returns> /// <returns>The current <see cref="RenderSession"/> instance for method chaining.</returns>
public RenderSessionBuilder WithAuto(bool enabled = true) public RenderSession WithAuto(bool enabled = true)
{ {
_auto = enabled; _auto = enabled;
return this; return this;
} }
public RenderSessionBuilder WithPatch(PatchType patchType, bool enabled = true) public RenderSession WithPatch(PatchType patchType, bool enabled = true)
{ {
switch (patchType) switch (patchType)
{ {
@@ -40,10 +41,16 @@ public class RenderSessionBuilder
/// <summary> /// <summary>
/// Applies the configured flags and initiates the render session. /// Applies the configured flags and initiates the render session.
/// </summary> /// </summary>
public void Start() public void Start(RenderConfig renderConfig, string levelPath)
{ {
RenderFlags.Auto = _auto; RenderContext.Auto = _auto;
RenderFlags.TimePatch = _timePatch; RenderContext.TimePatch = _timePatch;
RenderFlags.ScreenPatch = _screenPatch; RenderContext.ScreenPatch = _screenPatch;
RenderManager.Instance.levelPath = levelPath;
RenderManager.Instance.Configuration = renderConfig;
RenderManager.Instance.SetupCaptureDirectory();
RenderManager.Instance.SetupGameScene();
} }
} }