namespace MrGameEng.Core; /// Phase of a scene transition. public enum TransitionPhase { /// The old scene is being covered (coverage grows 0 → 1). Out, /// The new scene is being revealed (coverage shrinks 1 → 0). In, } /// /// Timing of a visual transition between scenes. The scene switch itself happens at full /// coverage, so a slow OnLoad of the next scene is hidden behind the overlay. /// Progress is tracked by on unscaled time, so transitions work /// while gameplay is paused. The core only times the phases — how the overlay looks is /// defined by the host (the MonoGame host's OverlayTransition and the /// Transitions factories); headless hosts simply let transitions pass invisibly. /// public abstract class Transition { /// Seconds the covering phase takes. public float OutDuration { get; } /// Seconds the revealing phase takes. public float InDuration { get; } /// Creates a transition with explicit phase durations. protected Transition(float outDuration, float inDuration) { OutDuration = Math.Max(0f, outDuration); InDuration = Math.Max(0f, inDuration); } }