Beispiel #1
0
        public static Vector3 SelectGate(DeathGateScene fromScene, DeathGateScene toScene)
        {
            Vector3 bestGatePosition;

            return(TrySelectGate(MySide, CompareDepth(fromScene, toScene), out bestGatePosition)
                ? bestGatePosition
                : Vector3.Zero);
        }
Beispiel #2
0
        public static GateSide GetSide(DeathGateScene scene, Vector3 position)
        {
            if (scene == null || !scene.IsValid)
            {
                return(GateSide.None);
            }
            var exitIsCloser = scene.DeepPortalPosition.Distance(position) < scene.ShallowPortalPosition.Distance(position);

            return(exitIsCloser ? GateSide.DeepSide : GateSide.ShallowSide);
        }
Beispiel #3
0
        public static SceneDepth CompareDepth(DeathGateScene thisScene, DeathGateScene otherScene)
        {
            var sequence = CreateSequence();
            var index    = sequence.IndexOf(otherScene);

            if (index >= 0)
            {
                if (index > sequence.Index)
                {
                    return(SceneDepth.Deeper);
                }
                if (index < sequence.Index)
                {
                    return(SceneDepth.Shallower);
                }
                if (index == sequence.Index)
                {
                    return(SceneDepth.Same);
                }
            }
            return(SceneDepth.NotFound);
        }
Beispiel #4
0
        public static SceneDepth CompareDepth(DeathGateScene thisScene, Vector3 targetPosition)
        {
            var targetScene = NearestGateSceneToPosition(targetPosition);

            return(CompareDepth(thisScene, targetScene));
        }