StonehearthEditor.GameMasterDataManager.RefreshGraph C# (CSharp) Method

RefreshGraph() public method

public RefreshGraph ( IGraphOwner graphOwner ) : void
graphOwner IGraphOwner
return void
        public void RefreshGraph(IGraphOwner graphOwner)
        {
            mGraph = new Graph();
            mGraph.Directed = true;
            mGraph.LayoutAlgorithmSettings = new SugiyamaLayoutSettings();

            if (mCurrentGraphRoot != null)
            {
                HashSet<GameMasterNode> campaignNodes = new HashSet<GameMasterNode>();
                mCurrentGraphRoot.NodeData.GetRelatedNodes(campaignNodes);

                foreach (GameMasterNode node in campaignNodes)
                {
                    GameMasterNodeType nodeType = node.NodeType;
                    if (nodeType == GameMasterNodeType.CAMP_PIECE || nodeType == GameMasterNodeType.UNKNOWN)
                    {
                        // Do not add camp pieces or unknown node types.
                        continue;
                    }

                    if (node.NodeData != null)
                    {
                        node.NodeData.UpdateGraph(mGraph);
                    }
                }

                graphOwner.SetGraph(mGraph);
            }
        }