refactor(runtime): own world reveal generation
This commit is contained in:
parent
4ab98b080e
commit
a6860d5563
26 changed files with 1294 additions and 502 deletions
|
|
@ -92,15 +92,59 @@ public enum RuntimePortalKind
|
|||
Portal,
|
||||
}
|
||||
|
||||
public readonly record struct RuntimeDestinationReadiness(
|
||||
long Generation,
|
||||
uint DestinationCell,
|
||||
bool IsIndoor,
|
||||
bool IsUnhydratable,
|
||||
int RequiredRenderRadius,
|
||||
bool IsRenderNeighborhoodReady,
|
||||
bool AreCompositeTexturesReady,
|
||||
bool IsCollisionReady)
|
||||
{
|
||||
public bool HasDestination => DestinationCell != 0u;
|
||||
|
||||
public bool IsReady => HasDestination
|
||||
&& (IsUnhydratable
|
||||
|| (IsRenderNeighborhoodReady
|
||||
&& AreCompositeTexturesReady
|
||||
&& IsCollisionReady));
|
||||
}
|
||||
|
||||
public readonly record struct RuntimePortalSnapshot(
|
||||
long Generation,
|
||||
RuntimePortalKind Kind,
|
||||
uint DestinationCell,
|
||||
bool IsReady,
|
||||
bool IsMaterialized,
|
||||
bool IsCompleted,
|
||||
bool IsCancelled,
|
||||
bool IsWorldVisible);
|
||||
RuntimeDestinationReadiness Readiness,
|
||||
bool Materialized,
|
||||
bool Completed,
|
||||
bool Cancelled,
|
||||
bool WorldViewportObserved,
|
||||
bool WorldSimulationAvailable,
|
||||
int InvariantFailureCount,
|
||||
bool WaitCueShown,
|
||||
int PortalMaterializationCount)
|
||||
{
|
||||
public static RuntimePortalSnapshot Idle { get; } = new(
|
||||
Generation: 0,
|
||||
RuntimePortalKind.None,
|
||||
Readiness: default,
|
||||
Materialized: false,
|
||||
Completed: false,
|
||||
Cancelled: false,
|
||||
WorldViewportObserved: false,
|
||||
WorldSimulationAvailable: true,
|
||||
InvariantFailureCount: 0,
|
||||
WaitCueShown: false,
|
||||
PortalMaterializationCount: 0);
|
||||
|
||||
public uint DestinationCell => Readiness.DestinationCell;
|
||||
public bool IsReady => Readiness.IsReady;
|
||||
public bool IsMaterialized => Materialized;
|
||||
public bool IsCompleted => Completed;
|
||||
public bool IsCancelled => Cancelled;
|
||||
public bool IsWorldVisible => WorldViewportObserved;
|
||||
public bool IsActive => Generation != 0 && !Cancelled;
|
||||
}
|
||||
|
||||
public interface IRuntimePortalView
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue