/// <summary> /// Initializes <see cref="TargetNodes"/> with all check-tagged nodes and the start node. /// Adds the check-tagged nodes to the provided SearchGraph. /// </summary> private void CreateTargetNodes(SearchGraph searchGraph) { TargetNodes = (from node in Settings.Checked where !searchGraph.NodeDict.ContainsKey(node) select searchGraph.AddNodeId(node.Id)) .Union(new[] { StartNode }).ToList(); }
/// <summary> /// Initializes <see cref="TargetNodes"/>. /// </summary> private void CreateTargetNodes() { _targetNodes = new HashSet <GraphNode>(); foreach (var nodeId in Settings.Checked) { // Don't add nodes that are already skilled. if (_searchGraph.NodeDict.ContainsKey(SkillTree.Skillnodes[nodeId])) { continue; } // Don't add nodes that should not be skilled. if (Settings.SubsetTree.Count > 0 && !Settings.SubsetTree.Contains(nodeId)) { continue; } // Add target node to the graph. var node = _searchGraph.AddNodeId(nodeId); _targetNodes.Add(node); } }