本文整理汇总了C#中Region.IsPartOf方法的典型用法代码示例。如果您正苦于以下问题:C# Region.IsPartOf方法的具体用法?C# Region.IsPartOf怎么用?C# Region.IsPartOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region.IsPartOf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Contains
public bool Contains( Region reg )
{
if ( reg == null || ( m_ForceMap != null && reg.Map != m_ForceMap ) )
return false;
return reg.IsPartOf( m_RegionName );
}
示例2: FromRegion
public static Town FromRegion( Region reg )
{
if ( reg.Map != Faction.Facet )
return null;
List<Town> towns = Towns;
for ( int i = 0; i < towns.Count; ++i )
{
Town town = towns[i];
if ( reg.IsPartOf( town.Definition.Region ) )
return town;
}
return null;
}
示例3: ISPARTOFREGION
public static bool ISPARTOFREGION(
TriggerObject trigObject, Region regionToTest, object region_OR_RegionType_Or_TypeString)
{
// this goes through the regionToTest and all its the parent regions to see if any of them are of type regionType
Region possibleParent = region_OR_RegionType_Or_TypeString as Region;
if (possibleParent != null)
{
return regionToTest.IsPartOf(possibleParent);
}
Type type;
if (region_OR_RegionType_Or_TypeString is string)
{
type = ScriptCompiler.FindTypeByName((string)region_OR_RegionType_Or_TypeString);
}
else if (region_OR_RegionType_Or_TypeString is Type)
{
type = (Type)region_OR_RegionType_Or_TypeString;
}
else
{
type = region_OR_RegionType_Or_TypeString.GetType();
}
return regionToTest.IsPartOf(type);
}
示例4: IsPartOfTest
public void IsPartOfTest()
{
XmlElement xml = null; // TODO: 初始化为适当的值
BaseMap map = null; // TODO: 初始化为适当的值
Region parent = null; // TODO: 初始化为适当的值
Region target = new Region( xml, map, parent ); // TODO: 初始化为适当的值
Type regionType = null; // TODO: 初始化为适当的值
bool expected = false; // TODO: 初始化为适当的值
bool actual;
actual = target.IsPartOf( regionType );
Assert.AreEqual( expected, actual );
Assert.Inconclusive( "验证此测试方法的正确性。" );
}