81 lines
2.3 KiB
C#
81 lines
2.3 KiB
C#
using UnityEngine;
|
|
|
|
namespace InfiniteWorld.VoxelWorld.Contracts
|
|
{
|
|
/// <summary>
|
|
/// Signals that a chunk now has valid nav geometry and dependent coverage windows should invalidate cached builds.
|
|
/// </summary>
|
|
public readonly struct ChunkNavGeometryReadyMessage
|
|
{
|
|
public ChunkNavGeometryReadyMessage(Vector2Int coord, int version)
|
|
{
|
|
Coord = coord;
|
|
Version = version;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Chunk coordinate whose nav geometry became available.
|
|
/// </summary>
|
|
public Vector2Int Coord { get; }
|
|
|
|
/// <summary>
|
|
/// Version of the chunk runtime state associated with this notification.
|
|
/// </summary>
|
|
public int Version { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Signals that a chunk's nav geometry is being removed so dependent coverage windows can drop stale build data.
|
|
/// </summary>
|
|
public readonly struct ChunkNavGeometryRemovedMessage
|
|
{
|
|
public ChunkNavGeometryRemovedMessage(Vector2Int coord, int version)
|
|
{
|
|
Coord = coord;
|
|
Version = version;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Chunk coordinate whose nav geometry is no longer available.
|
|
/// </summary>
|
|
public Vector2Int Coord { get; }
|
|
|
|
/// <summary>
|
|
/// Last known version of the chunk state before removal.
|
|
/// </summary>
|
|
public int Version { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Invalidates consumers that cache the current world interest set.
|
|
/// </summary>
|
|
public readonly struct WorldInterestChangedMessage
|
|
{
|
|
public WorldInterestChangedMessage(int version)
|
|
{
|
|
Version = version;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Monotonic version of the world interest state after the change.
|
|
/// </summary>
|
|
public int Version { get; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Invalidates consumers that cache transient nav coverage hints.
|
|
/// </summary>
|
|
public readonly struct NavCoverageHintChangedMessage
|
|
{
|
|
public NavCoverageHintChangedMessage(int version)
|
|
{
|
|
Version = version;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Monotonic version of the active nav hint state after the change.
|
|
/// </summary>
|
|
public int Version { get; }
|
|
}
|
|
}
|