using AcDream.App.World; using Xunit; namespace AcDream.App.Tests.World; /// /// The teleport-arrival readiness decision (#145/#138). /// /// Unhydratable claim → place immediately via the caller's safety-net (Impossible). /// Indoor (sealed dungeon / building interior) → hold until the EnvCell floor hydrates. /// Outdoor → place IMMEDIATELY on the server-authoritative position. Holding is futile — /// streaming does not progress while the player is held in PortalSpace, so the /// destination can't stream in during a hold. The stale source landblock is dropped at /// recenter (GameWindow.OnLivePositionUpdated), so the resolve falls through to the /// server cell (Resolve NO-LANDBLOCK verbatim) until the destination streams in. /// /// public class TeleportArrivalRulesTests { [Fact] public void Unhydratable_IsImpossible() { Assert.Equal(ArrivalReadiness.Impossible, TeleportArrivalRules.Decide(claimUnhydratable: true, indoor: false, indoorCellReady: false)); // …even for an indoor claim. Assert.Equal(ArrivalReadiness.Impossible, TeleportArrivalRules.Decide(claimUnhydratable: true, indoor: true, indoorCellReady: false)); } [Fact] public void Indoor_CellReady_IsReady() { Assert.Equal(ArrivalReadiness.Ready, TeleportArrivalRules.Decide(claimUnhydratable: false, indoor: true, indoorCellReady: true)); } [Fact] public void Indoor_CellNotReady_HoldsNotReady() { Assert.Equal(ArrivalReadiness.NotReady, TeleportArrivalRules.Decide(claimUnhydratable: false, indoor: true, indoorCellReady: false)); } [Fact] public void Outdoor_PlacesImmediately() { // #145: never hold an outdoor arrival — place at once on the server position. The // indoorCellReady flag is irrelevant for an outdoor destination. Assert.Equal(ArrivalReadiness.Ready, TeleportArrivalRules.Decide(claimUnhydratable: false, indoor: false, indoorCellReady: false)); } }