本文整理汇总了C#中Region.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Region.Contains方法的具体用法?C# Region.Contains怎么用?C# Region.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region.Contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EJECTREGIONPLAYERS
public static void EJECTREGIONPLAYERS(TriggerObject trigObject, Region region)
{
var mobs = region.GetMobiles();
ArrayList murdererRectangles = new ArrayList(MurdererEjectionRectangles);
ArrayList normalRectangles = new ArrayList(EjectionRectangles);
foreach (Mobile m in mobs)
{
if (m.Player)
{
if (m.Kills < 5)
{
if (!MOVETOSPAWNLOCATION(trigObject, m, Map.Felucca, normalRectangles))
{
m.MoveToWorld(new Point3D(2667, 2108, 0), Map.Felucca); // bucs, shouldn't ever get here really
}
}
else
{
if (!MOVETOSPAWNLOCATION(trigObject, m, Map.Felucca, murdererRectangles))
{
m.MoveToWorld(new Point3D(2667, 2108, 0), Map.Felucca); // bucs, shouldn't ever get here really
}
}
}
else if (m is BaseCreature)
{
BaseCreature bc = (BaseCreature)m;
if (bc.ControlMaster != null && bc.ControlMaster.Player && bc.ControlMaster.Map == Map.Felucca)
{
bc.MoveToWorld(bc.ControlMaster.Location, bc.ControlMaster.Map);
}
}
}
// now boot out any logged out mobs in the region
foreach (Mobile m in
World.Mobiles.Values.Where(
m =>
!m.Deleted && m.Player && m.Map == Map.Internal && m.LogoutMap == region.Map && region.Contains(m.LogoutLocation))
)
{
m.LogoutMap = Map.Felucca;
// brit bank : buc's den
m.LogoutLocation = m.Kills < 5 ? new Point3D(1438, 1690, 0) : new Point3D(2722, 2184, 0);
}
}
示例2: ContainsTest
public void ContainsTest()
{
XmlElement xml = null; // TODO: 初始化为适当的值
BaseMap map = null; // TODO: 初始化为适当的值
Region parent = null; // TODO: 初始化为适当的值
Region target = new Region( xml, map, parent ); // TODO: 初始化为适当的值
Point3D point3D = new Point3D(); // TODO: 初始化为适当的值
bool expected = false; // TODO: 初始化为适当的值
bool actual;
actual = target.Contains( point3D );
Assert.AreEqual( expected, actual );
Assert.Inconclusive( "验证此测试方法的正确性。" );
}
示例3: REGIONCONTAINS
public static bool REGIONCONTAINS(TriggerObject trigObject, Region region, IPoint3D location)
{
return region != null && location != null && region.Contains(new Point3D(location));
}
示例4: ClearBuildingsInRegion
/// <summary>
/// Clears the buildings in region.
/// </summary>
/// <param name='region'>
/// Region in world space.
/// </param>
private void ClearBuildingsInRegion(Region region)
{
Vector3 p;
GameObject[] instances = m_buildingInstances.ToArray();
foreach (GameObject go in instances) {
p = go.transform.position;
if (!region.Contains(p)) {
continue;
}
m_buildingInstances.Remove(go);
Destroy(go);
}
}