当前位置: 首页>>代码示例>>C#>>正文


C# Spawner.Start方法代码示例

本文整理汇总了C#中Server.Mobiles.Spawner.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Spawner.Start方法的具体用法?C# Spawner.Start怎么用?C# Spawner.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.Spawner的用法示例。


在下文中一共展示了Spawner.Start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateArray

		public void CreateArray( RelayInfo info, Mobile from, Spawner spawner )
		{
			spawner.CreaturesName = new ArrayList();
            spawner.CreaturesProbability = new ArrayList();

			for ( int i = 0;  i < 13; i++ )
			{
                //Creatures names
                TextRelay te = info.GetTextEntry(i);
				if ( te != null )
				{
					string str = te.Text;

					if ( str.Length > 0 )
					{
						str = str.Trim();

						Type type = SpawnerType.GetType( str );

                        if (type != null)
                        {
                            spawner.CreaturesName.Add(str);
                            //Creatures probabilities
                            te = info.GetTextEntry(20 + i);
                            try
                            {
                                if (te != null && te.Text.Length > 0 && Int32.Parse(te.Text) > 0)
                                    spawner.CreaturesProbability.Add(Int32.Parse(te.Text));
                                else
                                    spawner.CreaturesProbability.Add(DEFAULT_PROBABILTY);
                            }
                            catch { spawner.CreaturesProbability.Add(DEFAULT_PROBABILTY); }
                        }
                        else
                            from.SendMessage("{0} is not a valid type name.", str);
					}
                }
			}
            if (spawner.CreaturesName.Count > 0) spawner.Start();
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:40,代码来源:SpawnerGump.cs

示例2: CreateArray

		public void CreateArray( RelayInfo info, Mobile from, Spawner spawner )
		{
			int ocount = spawner.Entries.Count;

			List<SpawnerEntry> rementries = new List<SpawnerEntry>();

			for ( int i = 0;i < 13; i++ )
			{
				int index = i * 5;
				int entryindex = ( m_Page * 13 ) + i;

				TextRelay cte = info.GetTextEntry( index );
				TextRelay mte = info.GetTextEntry( index + 1 );
				TextRelay poste = info.GetTextEntry( index + 2 );
				TextRelay parmte = info.GetTextEntry( index + 3 );
				TextRelay propte = info.GetTextEntry( index + 4 );

				if ( cte != null )
				{
					string str = cte.Text.Trim().ToLower();

					if ( str.Length > 0 )
					{
						Type type = SpawnerType.GetType( str );

						if ( type != null )
						{
							SpawnerEntry entry = null;

							if ( entryindex < ocount )
							{
								entry = spawner.Entries[entryindex];
								entry.SpawnedName = str;

								if ( mte != null )
									entry.SpawnedMaxCount = Utility.ToInt32( mte.Text.Trim() );

								if ( poste != null )
									entry.SpawnedProbability = Utility.ToInt32( poste.Text.Trim() );
							}
							else
							{
								int maxcount = 1;
								int probcount = 100;

								if ( mte != null )
									maxcount = Utility.ToInt32( mte.Text.Trim() );

								if ( poste != null )
									probcount = Utility.ToInt32( poste.Text.Trim() );

								entry = spawner.AddEntry( str, probcount, maxcount );
							}

							if ( parmte != null )
								entry.Parameters = parmte.Text.Trim();

							if ( propte != null )
								entry.Properties = propte.Text.Trim();
						}
						else
							from.SendMessage( "{0} is not a valid type name for entry #{1}.", str, i );
					}
					else if ( entryindex < ocount && spawner.Entries[entryindex] != null )
						rementries.Add( spawner.Entries[entryindex] );
				}
			}

			if ( rementries.Count > 0 )
				for ( int i = 0; i < rementries.Count; i++ )
					spawner.RemoveEntry( rementries[i] );

			if ( ocount == 0 && spawner.Entries.Count > 0 )
				spawner.Start();
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:75,代码来源:SpawnerGump.cs


注:本文中的Server.Mobiles.Spawner.Start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。