public static void BuildRoomSpanningTree()
        {
            List <string> rooms = new List <string>();
            Dictionary <string, List <string> > roomTransitions = new Dictionary <string, List <string> >();

            foreach (string transition in LogicManager.TransitionNames())
            {
                if (transition == startTransition)
                {
                    continue;
                }
                TransitionDef def      = LogicManager.GetTransitionDef(transition);
                string        roomName = def.sceneName;
                if (new List <string> {
                    "Crossroads_46", "Crossroads_46b"
                }.Contains(roomName))
                {
                    roomName = "Crossroads_46";
                }
                if (new List <string> {
                    "Abyss_03", "Abyss_03_b", "Abyss_03_c"
                }.Contains(roomName))
                {
                    roomName = "Abyss_03";
                }
                if (new List <string> {
                    "Ruins2_10", "Ruins2_10b"
                }.Contains(roomName))
                {
                    roomName = "Ruins2_10";
                }

                if (!rooms.Contains(roomName) && !def.deadEnd && !def.isolated)
                {
                    rooms.Add(roomName);
                    roomTransitions.Add(roomName, new List <string>());
                }
            }

            foreach (string transition in LogicManager.TransitionNames())
            {
                if (transition == startTransition)
                {
                    continue;
                }
                TransitionDef def      = LogicManager.GetTransitionDef(transition);
                string        roomName = def.sceneName;
                if (def.oneWay == 0 && rooms.Contains(roomName))
                {
                    roomTransitions[roomName].Add(transition);
                }
            }

            BuildSpanningTree(roomTransitions);
        }
        public static void BuildAreaSpanningTree()
        {
            List <string> areas = new List <string>();
            Dictionary <string, List <string> > areaTransitions = new Dictionary <string, List <string> >();

            foreach (string transition in LogicManager.TransitionNames())
            {
                if (transition == startTransition)
                {
                    continue;
                }
                TransitionDef def      = LogicManager.GetTransitionDef(transition);
                string        areaName = def.areaName;
                if (new List <string> {
                    "City_of_Tears", "Forgotten_Crossroads", "Resting_Grounds"
                }.Contains(areaName))
                {
                    areaName = "Kings_Station";
                }
                if (new List <string> {
                    "Ancient_Basin", "Kingdoms_Edge"
                }.Contains(areaName))
                {
                    areaName = "Deepnest";
                }

                if (!areas.Contains(areaName) && !def.deadEnd && !def.isolated)
                {
                    areas.Add(areaName);
                    areaTransitions.Add(areaName, new List <string>());
                }
            }

            foreach (string transition in LogicManager.TransitionNames())
            {
                if (transition == startTransition)
                {
                    continue;
                }
                TransitionDef def      = LogicManager.GetTransitionDef(transition);
                string        areaName = def.areaName;
                if (def.oneWay == 0 && areas.Contains(areaName))
                {
                    areaTransitions[areaName].Add(transition);
                }
            }

            BuildSpanningTree(areaTransitions);
        }
        public static void BuildCARSpanningTree()
        {
            List <string> areas = new List <string>();
            Dictionary <string, List <string> > rooms = new Dictionary <string, List <string> >();

            foreach (string t in tm.unplacedTransitions)
            {
                if (t == startTransition)
                {
                    continue;
                }
                if (!LogicManager.GetTransitionDef(t).isolated || !LogicManager.GetTransitionDef(t).deadEnd)
                {
                    if (!areas.Contains(LogicManager.GetTransitionDef(t).areaName))
                    {
                        areas.Add(LogicManager.GetTransitionDef(t).areaName);
                        rooms.Add(LogicManager.GetTransitionDef(t).areaName, new List <string>());
                    }


                    if (!rooms[LogicManager.GetTransitionDef(t).areaName].Contains(LogicManager.GetTransitionDef(t).sceneName))
                    {
                        rooms[LogicManager.GetTransitionDef(t).areaName].Add(LogicManager.GetTransitionDef(t).sceneName);
                    }
                }
            }

            var areaTransitions = new Dictionary <string, Dictionary <string, List <string> > >(); // [area][scene][transition]

            foreach (string area in areas)
            {
                areaTransitions.Add(area, new Dictionary <string, List <string> >());
            }
            foreach (var kvp in rooms)
            {
                foreach (string room in kvp.Value)
                {
                    areaTransitions[kvp.Key].Add(room, new List <string>());
                }
            }
            foreach (string t in tm.unplacedTransitions)
            {
                if (t == startTransition)
                {
                    continue;
                }
                TransitionDef def = LogicManager.GetTransitionDef(t);
                if (!areas.Contains(def.areaName) || !areaTransitions[def.areaName].ContainsKey(def.sceneName))
                {
                    continue;
                }
                areaTransitions[def.areaName][def.sceneName].Add(t);
            }
            foreach (string area in areas)
            {
                BuildSpanningTree(areaTransitions[area]);
            }
            var worldTransitions = new Dictionary <string, List <string> >();

            foreach (string area in areas)
            {
                worldTransitions.Add(area, new List <string>());
            }
            foreach (string t in tm.unplacedTransitions)
            {
                if (t == startTransition)
                {
                    continue;
                }
                if (areas.Contains(LogicManager.GetTransitionDef(t).areaName) && rooms[LogicManager.GetTransitionDef(t).areaName].Contains(LogicManager.GetTransitionDef(t).sceneName))
                {
                    worldTransitions[LogicManager.GetTransitionDef(t).areaName].Add(t);
                }
            }
            BuildSpanningTree(worldTransitions);
        }