当前位置: 首页>>代码示例>>C#>>正文


C# GraphNode.MustBeEqual方法代码示例

本文整理汇总了C#中Pathfinding.GraphNode.MustBeEqual方法的典型用法代码示例。如果您正苦于以下问题:C# GraphNode.MustBeEqual方法的具体用法?C# GraphNode.MustBeEqual怎么用?C# GraphNode.MustBeEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pathfinding.GraphNode的用法示例。


在下文中一共展示了GraphNode.MustBeEqual方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompleteWith

		/** Completes the path using the specified target node.
		 * This method assumes that the node is a target node of the path
		 * not just any random node.
		 */
		void CompleteWith (GraphNode node) {
#if !ASTAR_NO_GRID_GRAPH
			if (endNode == node) {
				// Common case, no grid graph special case has been applied
				// Nothing to do
			} else {
				// See EndPointGridGraphSpecialCase()
				var gridNode = node as GridNode;
				if (gridNode == null) {
					throw new System.Exception("Some path is not cleaning up the flag1 field. This is a bug.");
				}

				// The grid graph special case has been applied
				// The closest point on the node is not yet known
				// so we need to calculate it
				endPoint = gridNode.ClosestPointOnNode(originalEndPoint);
				// This is now our end node
				// We didn't know it before, but apparently it was optimal
				// to move to this node
				endNode = node;
			}
#else
			// This should always be true unless
			// the grid graph special case has been applied
			// which can only happen if grid graphs have not
			// been stripped out with ASTAR_NO_GRID_GRAPH
			node.MustBeEqual(endNode);
#endif
			// Mark the path as completed
			CompleteState = PathCompleteState.Complete;
		}
开发者ID:smclallen,项目名称:Galactic_Parcel_Service,代码行数:35,代码来源:ABPath.cs


注:本文中的Pathfinding.GraphNode.MustBeEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。