本文整理汇总了C#中Server.Region类的典型用法代码示例。如果您正苦于以下问题:C# Region类的具体用法?C# Region怎么用?C# Region使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Region类属于Server命名空间,在下文中一共展示了Region类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CraftShopRegion
public CraftShopRegion( XmlElement xml, Map map, Region parent )
: base(xml, map, parent)
{
int skill = 0;
ReadInt32( xml, "skill", ref skill, true );
m_Skills = (CraftSkillType)skill;
}
示例2: CanSpawn
public static bool CanSpawn( Region region, params Type[] types )
{
while ( region != null )
{
if ( !region.AllowSpawn() )
return false;
BaseRegion br = region as BaseRegion;
if ( br != null )
{
if ( br.Spawns != null )
{
for ( int i = 0; i < br.Spawns.Length; i++ )
{
SpawnEntry entry = br.Spawns[i];
if ( entry.Definition.CanSpawn( types ) )
return true;
}
}
if ( br.ExcludeFromParentSpawns )
return false;
}
region = region.Parent;
}
return false;
}
示例3: QuestCompleteObjectiveRegion
public QuestCompleteObjectiveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
XmlElement questEl = xml["quest"];
ReadType( questEl, "type", ref m_Quest );
ReadType( questEl, "complete", ref m_Objective );
}
示例4: CampfireRegion
public CampfireRegion( Campfire campfire, Region existingRegion ) : base( "", "", campfire.Map )
{
Priority = Region.HousePriority;
LoadFromXml = false;
m_Campfire = campfire;
m_ExistingRegion = existingRegion;
}
示例5: GuardedRegion
public GuardedRegion( XmlElement xml, Map map, Region parent )
: base(xml, map, parent)
{
XmlElement el = xml["guards"];
if ( ReadType( el, "type", ref m_GuardType, false ) )
{
if ( !typeof( Mobile ).IsAssignableFrom( m_GuardType ) )
{
Console.WriteLine( "Invalid guard type for region '{0}'", this );
m_GuardType = DefaultGuardType;
}
}
else
{
m_GuardType = DefaultGuardType;
}
bool disabled = false;
if ( ReadBoolean( el, "disabled", ref disabled, false ) )
this.Disabled = disabled;
if ( Name != null )
RuneName = String.Format( "the city of {0}", Name );
}
示例6: RegionContains
public static bool RegionContains(Region region, Mobile m)
{
#if(RunUO_1_Final)
return region.Mobiles.Contains(m);
#elif(RunUO_2_RC1)
return region.GetMobiles().Contains(m);
#endif
}
示例7: QuestNoEntryRegion
public QuestNoEntryRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
XmlElement questEl = xml["quest"];
ReadType( questEl, "type", ref m_Quest );
ReadType( questEl, "min", ref m_MinObjective, false );
ReadType( questEl, "max", ref m_MaxObjective, false );
ReadInt32( questEl, "message", ref m_Message, false );
}
示例8: DungeonRegion
public DungeonRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
{
XmlElement entrEl = xml["entrance"];
Map entrMap = map;
ReadMap( entrEl, "map", ref entrMap, false );
if ( ReadPoint3D( entrEl, entrMap, ref m_EntranceLocation, false ) )
m_EntranceMap = entrMap;
}
示例9: ShowRegionBounds
public static void ShowRegionBounds(Region r, Mobile from, bool control, bool active)
{
if (r == null)
return;
foreach (Rectangle3D rect in r.Area)
{
ShowRectBounds(rect, r.Map, from, control, active);
}
}
示例10: IsMLRegion
public static bool IsMLRegion( Region region )
{
return region.IsPartOf( "Twisted Weald" )
|| region.IsPartOf( "Sanctuary" )
|| region.IsPartOf( "The Prism of Light" )
|| region.IsPartOf( "The Citadel" )
|| region.IsPartOf( "Bedlam" )
|| region.IsPartOf( "Blighted Grove" )
|| region.IsPartOf( "The Painted Caves" )
|| region.IsPartOf( "The Palace of Paroxysmus" )
|| region.IsPartOf( "Labyrinth" );
}
示例11: RegionCategory
//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
public static string RegionCategory( Region currentRegion )
{
string str;
if( currentRegion is GuardedRegion ) { str = "Guarded"; }
else if( currentRegion is HouseRegion ) { str = "House"; }
else if( currentRegion is DungeonRegion ) { str = "Dungeon"; }
else if( currentRegion is Jail ) { str = "Jail"; }
else if( currentRegion is GreenAcres ) { str = "GreenAcres"; }
else { str = "Wilderness"; }
return str;
}
示例12: ShowRegionBounds
public static void ShowRegionBounds( Region r )
{
if( r == null || r.Coords == null || r.Coords.Count == 0)
return;
ArrayList c = r.Coords;
for( int i = 0; i < c.Count; i++ )
{
if( c[i] is Rectangle2D )
ShowRectBounds( (Rectangle2D)c[i], r.Map );
}
}
示例13: GetRegionCollection
public static LootCollection GetRegionCollection( Type type, Region region )
{
if ( region is BaseRegion )
{
LootCollection coll;
((BaseRegion)region).LootTable.TryGetValue( type, out coll );
return coll;
}
return null;
}
示例14: GetRuneNameFor
public static string GetRuneNameFor( Region region )
{
while ( region != null )
{
BaseRegion br = region as BaseRegion;
if ( br != null && br.m_RuneName != null )
return br.m_RuneName;
region = region.Parent;
}
return null;
}
示例15: ApprenticeObjective
public ApprenticeObjective( SkillName skill, int cap, string region, object enterRegion, object leaveRegion )
: base(cap)
{
m_Skill = skill;
if ( region != null )
{
m_Region = QuestHelper.FindRegion( region );
m_Enter = enterRegion;
m_Leave = leaveRegion;
if ( m_Region == null )
Console.WriteLine( String.Format( "Invalid region name ('{0}') in '{1}' objective!", region, GetType() ) );
}
}