本文整理汇总了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();
}
示例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;
}