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 ADOFAIRenderer.Core;
using ADOFAIRenderer.Data;
namespace ADOFAIRenderer.API;
/// <summary>
/// Fluent builder for configuring and starting a render session.
/// </summary>
public class RenderSessionBuilder
public class RenderSession
{
private bool _auto = true;
@@ -18,14 +19,14 @@ public class RenderSessionBuilder
/// Sets whether automatic rendering is enabled.
/// </summary>
/// <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>
public RenderSessionBuilder WithAuto(bool enabled = true)
/// <returns>The current <see cref="RenderSession"/> instance for method chaining.</returns>
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
/// <summary>
/// Applies the configured flags and initiates the render session.
/// </summary>
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();
}
}