本文整理汇总了C#中Vehicle.CanTraverse方法的典型用法代码示例。如果您正苦于以下问题:C# Vehicle.CanTraverse方法的具体用法?C# Vehicle.CanTraverse怎么用?C# Vehicle.CanTraverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vehicle
的用法示例。
在下文中一共展示了Vehicle.CanTraverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestVehicleCanTranverse
/// <summary>
/// Tests the can traverse functionality.
/// </summary>
protected void TestVehicleCanTranverse(Vehicle vehicle, bool result, params string[] tags)
{
// build tags collection.
TagsCollection tagsCollection = new TagsCollection();
for (int idx = 0; idx < tags.Length; idx = idx + 2)
{
tagsCollection.Add(tags[idx], tags[idx + 1]);
}
if (result)
{ // assume the result is true.
Assert.IsTrue(vehicle.CanTraverse(tagsCollection));
}
else
{ // assume the result is false.
Assert.IsFalse(vehicle.CanTraverse(tagsCollection));
}
}
示例2: CanBeTraversedBy
/// <summary>
/// Returns true if the edge with given tags can be traversed by the given vehicle.
/// </summary>
/// <param name="tags"></param>
/// <param name="vehicle"></param>
/// <returns></returns>
public bool CanBeTraversedBy(TagsCollectionBase tags, Vehicle vehicle)
{
return vehicle.CanTraverse(tags);
}