acdream/src/AcDream.App/Streaming/ResidentStreamingWindowFact.cs

31 lines
1,023 B
C#

namespace AcDream.App.Streaming;
/// <summary>
/// Read-only presentation fact describing the complete portion of the live
/// two-tier landblock window. A landblock is 192 metres wide. Radius zero means
/// only the centre is published and therefore offers no safe camera-relative
/// cascade reach beyond that landblock.
/// </summary>
internal readonly record struct ResidentStreamingWindowFact(
ulong Revision,
int CenterX,
int CenterY,
int CompleteRadiusLandblocks,
int PublishedLandblockCount,
bool HasPublishedCenter)
{
internal const float LandblockSizeMeters = 192f;
internal float MaximumReachMeters => HasPublishedCenter
? CompleteRadiusLandblocks * LandblockSizeMeters
: 0f;
internal static ResidentStreamingWindowFact Unavailable(ulong revision) =>
new(
revision,
CenterX: 0,
CenterY: 0,
CompleteRadiusLandblocks: 0,
PublishedLandblockCount: 0,
HasPublishedCenter: false);
}