SHA256
Create RenderSession
This commit is contained in:
1 file changed
+15
-8
+15
-8
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user