Files
TheriapolisV3/Theriapolis.Core/World/Generation/WorldGenContext.cs
T
Christopher Wiebe b451f83174 Initial commit: Theriapolis baseline at port/godot branch point
Captures the pre-Godot-port state of the codebase. This is the rollback
anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md).
All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 20:40:51 -07:00

38 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Theriapolis.Core.Data;
using Theriapolis.Core.Util;
namespace Theriapolis.Core.World.Generation;
/// <summary>
/// Accumulating context passed through the world-generation pipeline.
/// Holds the WorldState under construction, per-subsystem RNG streams, and a logger.
/// </summary>
public sealed class WorldGenContext
{
public WorldState World { get; }
/// <summary>Named RNG sub-streams, keyed by the subsystem constant name.</summary>
public Dictionary<string, SeededRng> Rngs { get; } = new();
/// <summary>Directory that holds macro_template.json, biomes.json, etc.</summary>
public string DataDirectory { get; init; } = "";
/// <summary>Called after each stage completes: (stageName, progressFraction 01).</summary>
public Action<string, float>? ProgressCallback { get; set; }
/// <summary>Simple diagnostic log sink.</summary>
public Action<string>? Log { get; set; }
public WorldGenContext(ulong seed, string dataDirectory)
{
World = new WorldState { WorldSeed = seed };
DataDirectory = dataDirectory;
}
public void ReportProgress(string stageName, float fraction)
=> ProgressCallback?.Invoke(stageName, Math.Clamp(fraction, 0f, 1f));
public void LogMessage(string msg)
=> Log?.Invoke(msg);
}