本文整理汇总了C#中IArea.IsIntersectingZone方法的典型用法代码示例。如果您正苦于以下问题:C# IArea.IsIntersectingZone方法的具体用法?C# IArea.IsIntersectingZone怎么用?C# IArea.IsIntersectingZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IArea
的用法示例。
在下文中一共展示了IArea.IsIntersectingZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddArea
/// <summary>
/// Adds an area to the region and updates area-zone cache
/// </summary>
/// <param name="area"></param>
/// <returns></returns>
public virtual IArea AddArea(IArea area)
{
lock (m_lockAreas)
{
ushort nextAreaID = 0;
foreach (ushort areaID in m_Areas.Keys)
{
if (areaID >= nextAreaID)
{
nextAreaID = (ushort)(areaID + 1);
}
}
area.ID = nextAreaID;
m_Areas.Add(area.ID, area);
int zonePos = 0;
foreach (Zone zone in Zones)
{
if (area.IsIntersectingZone(zone))
m_ZoneAreas[zonePos][m_ZoneAreasCount[zonePos]++] = area.ID;
zonePos++;
}
return area;
}
}
示例2: AddArea
/// <summary>
/// Adds an area to the region and updates area-zone cache
/// </summary>
/// <param name="area"></param>
/// <returns></returns>
public virtual IArea AddArea(IArea area)
{
lock (m_Areas.SyncRoot)
{
m_Areas.Add(area);
area.ID = (ushort)(m_Areas.Count - 1);
for (int i = 0; i < Zones.Count; i++)
{
Zone zone = (Zone)Zones[i];
if (!area.IsIntersectingZone(zone))
continue;
m_ZoneAreas[i][m_ZoneAreasCount[i]++] = area.ID;
}
return area;
}
}