本文整理汇总了C#中Server.Mobiles.Spawner.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Spawner.GetType方法的具体用法?C# Spawner.GetType怎么用?C# Spawner.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.Spawner
的用法示例。
在下文中一共展示了Spawner.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteSpawner
public static void WriteSpawner( XmlTextWriter xml, Spawner spawner )
{
xml.WriteStartElement( "Spawner" );
if ( spawner is ProximitySpawner || spawner is MasterDistSpawner )
xml.WriteAttributeString( "Type", spawner.GetType().Name );
//xml.WriteAttributeString( "Active", spawner.Running.ToString() );
if ( !String.IsNullOrEmpty( spawner.Name ) && spawner.Name != "Spawner" && spawner.Name != spawner.DefaultName )
{
xml.WriteStartElement( "Name" );
xml.WriteString( spawner.Name );
xml.WriteEndElement();
}
if ( spawner.Team != 0 )
{
xml.WriteStartElement( "Team" );
xml.WriteString( spawner.Team.ToString() );
xml.WriteEndElement();
}
xml.WriteStartElement( "HomeRange" );
xml.WriteString( spawner.HomeRange.ToString() );
xml.WriteEndElement();
xml.WriteStartElement( "Count" );
xml.WriteString( spawner.Count.ToString() );
xml.WriteEndElement();
if ( spawner.WalkingRange >= 0 )
{
xml.WriteStartElement( "WalkingRange" );
xml.WriteString( spawner.WalkingRange.ToString() );
xml.WriteEndElement();
}
xml.WriteStartElement( "MinDelay" );
xml.WriteString( spawner.MinDelay.ToString() );
xml.WriteEndElement();
xml.WriteStartElement( "MaxDelay" );
xml.WriteString( spawner.MinDelay.ToString() );
xml.WriteEndElement();
xml.WriteStartElement( "Location" );
xml.WriteString( spawner.Location.ToString() );
xml.WriteEndElement();
xml.WriteStartElement( "Map" );
xml.WriteString( spawner.Map.ToString() );
xml.WriteEndElement();
if ( spawner.WayPoint != null )
{
xml.WriteStartElement( "WayPoint" );
xml.WriteString( spawner.WayPoint.Serial.ToString() );
xml.WriteEndElement();
}
if ( spawner is ProximitySpawner )
{
ProximitySpawner prox = spawner as ProximitySpawner;
xml.WriteAttributeString( "InstantFlag", prox.InstantFlag.ToString() );
xml.WriteStartElement( "TriggerRange" );
xml.WriteString( prox.TriggerRange.ToString() );
xml.WriteEndElement();
if ( prox.SpawnMessage != null )
{
xml.WriteStartElement( "SpawnMessage" );
xml.WriteAttributeString( "Local", prox.SpawnMessage.Number.ToString() );
xml.WriteString( prox.SpawnMessage.String );
xml.WriteEndElement();
}
}
else if ( spawner is MasterDistSpawner )
{
MasterDistSpawner master = spawner as MasterDistSpawner;
xml.WriteStartElement( "IsChild" );
xml.WriteString( master.IsChild.ToString() );
xml.WriteEndElement();
xml.WriteStartElement( "Children" );
xml.WriteAttributeString( "Count", (master.Children.Count - ( master.IsChild ? 1 : 0 )).ToString() );
foreach ( IChildDistSpawner child in master.Children )
if ( child != spawner && child is ChildDistSpawner )
WriteChildDistSpawner( xml, (ChildDistSpawner)child );
xml.WriteEndElement(); // Children
}
xml.WriteStartElement( "Entries" );
xml.WriteAttributeString( "Count", spawner.Entries.Count.ToString() );
//.........这里部分代码省略.........