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


C# Action.GetHashCode方法代码示例

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


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

示例1: RequestPath

 /// <summary>
 /// Request a path from point pathStart to point pathEnd, in a specific grid.
 /// </summary>
 /// <param name="pathStart">The starting point of the path</param>
 /// <param name="pathEnd">The ending point of the path</param>
 /// <param name="callback">A function with the parameters (Path)</param>
 /// <param name="grid">The specific grid you want to find the path on.</param>
 public static void RequestPath(Vector3 pathStart, Vector3 pathEnd, Action<Path> callback, GridGraph grid = null)
 {
     if (grid == null)
     {
         grid = Grid;
     }
     if (grid.Scanning)
     {
         return;
     }
     string Name = callback.GetHashCode().ToString();
     PathRequest newRequest = new PathRequest(pathStart, pathEnd, callback, Name, grid);
     PathRequest contains = instance.pathRequests.Contains(Name);
     if (contains != null)
     {
         instance.pathRequests.Remove(contains);
     }
     instance.pathRequests.Enqueue(newRequest);
     instance.Process();
 }
开发者ID:Unknown-Studios,项目名称:OnePathfinding,代码行数:27,代码来源:GridManager.cs

示例2: Contains

 /// <summary>
 /// Check if the queue contains the agent with the Callback callback.
 /// </summary>
 /// <param name="callback">The callback to check for,</param>
 /// <returns>Whether or not it contains the object.</returns>
 public static bool Contains(Action<Path> callback)
 {
     if (instance.pathRequests.Contains(callback.GetHashCode().ToString()) != null)
     {
         return true;
     }
     return false;
 }
开发者ID:Unknown-Studios,项目名称:OnePathfinding,代码行数:13,代码来源:GridManager.cs


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