// Token: 0x06001E06 RID: 7686 RVA: 0x0008137F File Offset: 0x0007F57F public NodeGraphSpider(NodeGraph nodeGraph, HullMask hullMask) { this.nodeGraph = nodeGraph; this.hullMask = hullMask; this.collectedSteps = new List <NodeGraphSpider.StepInfo>(); this.uncheckedSteps = new List <NodeGraphSpider.StepInfo>(); this.visitedNodes = new BitArray(nodeGraph.GetNodeCount()); }
// Token: 0x06001DE0 RID: 7648 RVA: 0x000802BC File Offset: 0x0007E4BC public List <NodeGraph.NodeIndex> GetActiveNodesForHullMask(HullMask hullMask) { List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(this.nodes.Length); for (int i = 0; i < this.nodes.Length; i++) { if ((this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { list.Add(new NodeGraph.NodeIndex(i)); } } return(list); }
// Token: 0x06001DEA RID: 7658 RVA: 0x00080838 File Offset: 0x0007EA38 public bool IsLinkSuitableForHull(NodeGraph.LinkIndex linkIndex, HullMask hullMask) { return(linkIndex != NodeGraph.LinkIndex.invalid && linkIndex.linkIndex < this.links.Length && (this.links[linkIndex.linkIndex].hullMask & (int)hullMask) != 0 && (this.links[linkIndex.linkIndex].gateIndex == 0 || this.openGates[(int)this.links[linkIndex.linkIndex].gateIndex])); }
// Token: 0x06001DE3 RID: 7651 RVA: 0x0008048C File Offset: 0x0007E68C public List <NodeGraph.NodeIndex> FindNodesInRangeWithFlagConditions(Vector3 position, float minRange, float maxRange, HullMask hullMask, NodeFlags requiredFlags, NodeFlags forbiddenFlags, bool preventOverhead) { float num = minRange * minRange; float num2 = maxRange * maxRange; List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(); for (int i = 0; i < this.nodes.Length; i++) { NodeFlags flags = this.nodes[i].flags; if ((flags & forbiddenFlags) == NodeFlags.None && (flags & requiredFlags) == requiredFlags && (this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { Vector3 a = this.nodes[i].position - position; float sqrMagnitude = a.sqrMagnitude; if (sqrMagnitude >= num && sqrMagnitude <= num2 && (!preventOverhead || Vector3.Dot(a / Mathf.Sqrt(sqrMagnitude), Vector3.up) <= 0.70710677f)) { list.Add(new NodeGraph.NodeIndex(i)); } } } return(list); }
// Token: 0x06001DE2 RID: 7650 RVA: 0x000803DC File Offset: 0x0007E5DC public List <NodeGraph.NodeIndex> FindNodesInRange(Vector3 position, float minRange, float maxRange, HullMask hullMask) { float num = minRange * minRange; float num2 = maxRange * maxRange; List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(); for (int i = 0; i < this.nodes.Length; i++) { if ((this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { float sqrMagnitude = (this.nodes[i].position - position).sqrMagnitude; if (sqrMagnitude >= num && sqrMagnitude <= num2) { list.Add(new NodeGraph.NodeIndex(i)); } } } return(list); }
// Token: 0x06001DE1 RID: 7649 RVA: 0x0008033C File Offset: 0x0007E53C public List <NodeGraph.NodeIndex> GetActiveNodesForHullMaskWithFlagConditions(HullMask hullMask, NodeFlags requiredFlags, NodeFlags forbiddenFlags) { List <NodeGraph.NodeIndex> list = new List <NodeGraph.NodeIndex>(this.nodes.Length); for (int i = 0; i < this.nodes.Length; i++) { NodeFlags flags = this.nodes[i].flags; if ((flags & forbiddenFlags) == NodeFlags.None && (flags & requiredFlags) == requiredFlags && (this.nodes[i].forbiddenHulls & hullMask) == HullMask.None && (this.nodes[i].gateIndex == 0 || this.openGates[(int)this.nodes[i].gateIndex])) { list.Add(new NodeGraph.NodeIndex(i)); } } return(list); }
// Token: 0x06001DD9 RID: 7641 RVA: 0x0007FC08 File Offset: 0x0007DE08 public void SetNodes(ReadOnlyCollection <MapNode> mapNodes, ReadOnlyCollection <SerializableBitArray> lineOfSightMasks) { this.Clear(); Dictionary <MapNode, NodeGraph.NodeIndex> dictionary = new Dictionary <MapNode, NodeGraph.NodeIndex>(); List <NodeGraph.Node> list = new List <NodeGraph.Node>(); List <NodeGraph.Link> list2 = new List <NodeGraph.Link>(); for (int i = 0; i < mapNodes.Count; i++) { MapNode key = mapNodes[i]; dictionary[key] = new NodeGraph.NodeIndex(i); } for (int j = 0; j < mapNodes.Count; j++) { MapNode mapNode = mapNodes[j]; NodeGraph.NodeIndex nodeIndexA = dictionary[mapNode]; int count = list2.Count; for (int k = 0; k < mapNode.links.Count; k++) { MapNode.Link link = mapNode.links[k]; if (!dictionary.ContainsKey(link.nodeB)) { Debug.LogErrorFormat(link.nodeB, "[{0}] Node {1} was not registered.", new object[] { k, link.nodeB }); } list2.Add(new NodeGraph.Link { nodeIndexA = nodeIndexA, nodeIndexB = dictionary[link.nodeB], distanceScore = link.distanceScore, minJumpHeight = link.minJumpHeight, hullMask = link.hullMask, jumpHullMask = link.jumpHullMask, gateIndex = this.RegisterGateName(link.gateName) }); } HullMask hullMask = mapNode.forbiddenHulls; for (HullClassification hullClassification = HullClassification.Human; hullClassification < HullClassification.Count; hullClassification++) { bool flag = false; int num = 1 << (int)hullClassification; List <MapNode.Link> list3 = mapNode.links; for (int l = 0; l < list3.Count; l++) { if ((list3[l].hullMask & num) != 0) { flag = true; break; } } if (!flag) { hullMask |= (HullMask)num; } } list.Add(new NodeGraph.Node { position = mapNode.transform.position, linkListIndex = new NodeGraph.LinkListIndex { index = count, size = (uint)mapNode.links.Count }, forbiddenHulls = hullMask, flags = mapNode.flags, lineOfSightMask = new SerializableBitArray(lineOfSightMasks[j]), gateIndex = this.RegisterGateName(mapNode.gateName) }); } this.nodes = list.ToArray(); this.links = list2.ToArray(); }