本文整理匯總了C#中System.Objects.GetArea方法的典型用法代碼示例。如果您正苦於以下問題:C# Objects.GetArea方法的具體用法?C# Objects.GetArea怎麽用?C# Objects.GetArea使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Objects
的用法示例。
在下文中一共展示了Objects.GetArea方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsInAreaEffect
/// <summary>
/// Checks whether this location is inside a pre-defined area.
/// </summary>
/// <param name="areaEffect">The area effect used.</param>
/// <param name="location">The center of the area.</param>
/// <param name="direction">The direction of the area effect used.</param>
/// <returns></returns>
public bool IsInAreaEffect(Objects.AreaEffect areaEffect, Objects.Location location,
Enums.Direction direction)
{
ushort y = 0;
Objects.Location currentLoc = this.Clone();
byte dir = areaEffect.Type == AreaEffect.EffectType.Spell ? (byte)direction : (byte)1;
foreach (byte[] row in areaEffect.GetArea())
{
int center = row.Length / 2;
for (int i = 0; i < row.Length; i++)
{
if (row[i] != dir) continue;
if (location.Offset(i - center, y, 0) == currentLoc) return true;
}
y++;
}
return false;
}