Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** True if the node contains any blocker which is not included in the \a selector list */
- public bool NodeContainsAnyExcept (GraphNode node, List<SingleNodeBlocker> selector) {
- List<SingleNodeBlocker> blockersInNode;
- if (!blocked.TryGetValue(node, out blockersInNode)) {
- return false;
- }
- for (int i = 0; i < blockersInNode.Count; i++) {
- var inNode = blockersInNode[i];
- bool found = false;
- for (int j = 0; j < selector.Count; j++) {
- // Need to use ReferenceEquals because this code may be called from a separate thread
- // and the equality comparison that Unity provides is not thread safe
- if (System.Object.ReferenceEquals(inNode, selector[j])) {
- found = true;
- break;
- }
- }
- if (!found) return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement