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);
}
}