Пример #1
0
        /// <summary>
        /// If the edge contains the Once tag it should be skipped unless an enabled fix is also tagged.
        /// </summary>
        /// <param name="edge">Edge to check.</param>
        /// <returns>True if the edge can be skipped.</returns>
        private bool IsOnceEdge(ModuleEdge edge)
        {
            bool isOnce = false;

            if (edge.IsOnce)
            {
                if ((EnabledFixBox && edge.IsFixBox) ||
                    (EnabledFixElev && edge.IsFixElev) ||
                    (EnabledFixMap && edge.IsFixMap) ||
                    (EnabledFixSpice && edge.IsFixSpice) ||
                    (EnabledUnlockDanRuins && edge.IsUnlockDanRuins) ||
                    (EnabledUnlockManSub && edge.IsUnlockManSub) ||
                    (EnabledUnlockStaBastila && edge.IsUnlockStaBastila) ||
                    (EnabledUnlockUnkSummit && edge.IsUnlockUnkSummit))
                {
                    isOnce = false;
                }
                else
                {
                    isOnce = true;
                }
            }
            else
            {
                isOnce = false;
            }
            return(isOnce);
        }
Пример #2
0
        /// <summary>
        /// If the edge contains the Locked tag it should be skipped unless an enabled fix or glitch is also tagged or
        /// if all of the edge's unlocks are reachable.
        /// </summary>
        /// <param name="edge">Edge to check.</param>
        /// <returns>True if the edge can be skipped.</returns>
        private bool IsLockedEdge(ModuleEdge edge)
        {
            bool isLocked = false;

            if (edge.IsLocked)
            {
                // Check to see if we can bypass this lock with an allowed glitch or enabled fix.
                if ((AllowGlitchClip && edge.IsClip) ||
                    (AllowGlitchDlz && edge.IsDlz) ||
                    (AllowGlitchFlu && edge.IsFlu) ||                       // How to handle FluReq? One FLU still requires Carth...
                    (AllowGlitchGpw && edge.IsGpw) ||
                    (EnabledFixBox && edge.IsFixBox) ||
                    (EnabledFixElev && edge.IsFixElev) ||
                    (EnabledFixMap && edge.IsFixMap) ||
                    (EnabledFixSpice && edge.IsFixSpice) ||
                    (EnabledUnlockDanRuins && edge.IsUnlockDanRuins) ||
                    (EnabledUnlockManSub && edge.IsUnlockManSub) ||
                    (EnabledUnlockStaBastila && edge.IsUnlockStaBastila) ||
                    (EnabledUnlockUnkSummit && edge.IsUnlockUnkSummit))
                {
                    isLocked = false;
                }
                else
                {
                    // Check to see if the edge can be unlocked by any of the possible sets.
                    var unlocked = true;
                    foreach (var set in edge.UnlockSets)
                    {
                        // Reset assumption to true, as we're just looking for one false in each set.
                        unlocked = true;

                        // ALL vertices within a set need to be reachable.
                        foreach (var target in set)
                        {
                            // If the tag is not in Reachable, then it's a one that we haven't seen and the edge is still locked.
                            if (!Reachable.ContainsKey(target))
                            {
                                Reachable.Add(target, false);
                                unlocked = false;
                                break;
                            }

                            // If not Reachable, then the edge is still locked.
                            if (!Reachable[target])
                            {
                                unlocked = false;
                                break;
                            }
                        }

                        // If a reachable set has been found, break out of the loop.
                        if (unlocked)
                        {
                            break;
                        }
                    }

                    // Set return value.
                    isLocked = !unlocked;
                }
            }
            else
            {
                // Edge isn't locked.
                isLocked = false;
            }
            return(isLocked);
        }