add documentation

This commit is contained in:
Alexander Borisov
2026-04-08 20:58:30 +03:00
parent 31826bd4e0
commit 1681e44c5e
11 changed files with 240 additions and 0 deletions
@@ -7,6 +7,9 @@ using VContainer.Unity;
namespace InfiniteWorld.VoxelWorld.NavMesh
{
/// <summary>
/// Stores short-lived route hints and expands them into interest points so nav coverage can prewarm ahead of movement.
/// </summary>
public sealed class NavCoverageHintService : ITickable, INavCoverageHintRegistry, INavCoverageHintReader
{
private readonly IChunkNavSourceReader chunkNavSourceReader;
@@ -27,8 +30,14 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
this.hintChangedPublisher = hintChangedPublisher;
}
/// <summary>
/// Increments whenever the effective set of active hints changes and cached coverage planning should be invalidated.
/// </summary>
public int HintVersion => hintVersion;
/// <summary>
/// Expires hints whose time-to-live has elapsed so stale route bias does not keep shaping coverage forever.
/// </summary>
public void Tick()
{
if (hints.Count == 0)
@@ -61,6 +70,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
NotifyHintsChanged();
}
/// <summary>
/// Registers or refreshes a temporary linear corridor for one owner so coverage can be biased along an upcoming route.
/// </summary>
public void SetLinearHint(int ownerId, Vector3 from, Vector3 to, float priority, float ttlSeconds)
{
if (ownerId == 0)
@@ -74,6 +86,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
NotifyHintsChanged();
}
/// <summary>
/// Removes a previously registered route hint once the owner no longer needs prewarmed coverage.
/// </summary>
public void ClearHint(int ownerId)
{
if (!hints.Remove(ownerId))
@@ -84,6 +99,9 @@ namespace InfiniteWorld.VoxelWorld.NavMesh
NotifyHintsChanged();
}
/// <summary>
/// Appends the currently active hint points so the main coverage scheduler can treat them like supplemental interest.
/// </summary>
public void GetHintPoints(List<WorldInterestPoint> results)
{
if (results == null)