本文整理匯總了C#中System.Objects.IsValid方法的典型用法代碼示例。如果您正苦於以下問題:C# Objects.IsValid方法的具體用法?C# Objects.IsValid怎麽用?C# Objects.IsValid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Objects
的用法示例。
在下文中一共展示了Objects.IsValid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UseItemOnLocation
/// <summary>
/// Attempts to use an item on a world location.
/// If possible, use UseItemOnTile instead, as it provides better performance.
/// </summary>
/// <param name="itemLocation">The item's location.</param>
/// <param name="loc">The world location to use the item on.</param>
public void UseItemOnLocation(Objects.ItemLocation itemLocation, Objects.Location loc)
{
if (itemLocation == null || !loc.IsValid()) return;
this.UseItemOnTile(itemLocation, this.Client.Map.GetTile(loc, null));
}
示例2: HotkeyUseItemOnLocation
/// <summary>
/// Attempts to use an item on a world location.
/// </summary>
/// <param name="itemid">The item's ID.</param>
/// <param name="loc">The world location to use the item on.</param>
public void HotkeyUseItemOnLocation(ushort itemid, Objects.Location loc)
{
if (itemid == 0 || !loc.IsValid()) return;
}