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


C# CommandEventArgs.GetDouble方法代码示例

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


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

示例1: SetSkill_OnCommand

		public static void SetSkill_OnCommand( CommandEventArgs arg )
		{
			if( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkill <skill name> <value>" );
			}
			else
			{
				SkillName skill;
#if Framework_4_0
				if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
				{
					arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
				}
				else
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
				}
#else
				try
				{
					skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
				}
				catch
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
					return;
				}
				arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
#endif
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:32,代码来源:Skills.cs

示例2: RepeatSoundCommand_OnCommand

		public static void RepeatSoundCommand_OnCommand( CommandEventArgs args )
		{
			if( args.Length == 2 )
			{
				Timer timer = null;
				bool foundValue = false;
				int soundID = args.GetInt32( 0 );
				double interval = args.GetDouble( 1 );

				if( m_Table.ContainsKey( soundID ) )
					foundValue = m_Table.TryGetValue( soundID, out timer );

				if( foundValue || timer != null )
				{
					if( timer != null )
						timer.Stop();

					if( m_Table.Remove( soundID ) )
						args.Mobile.SendMessage( "RepeatSound process with sound index {0} halted.", soundID );
				}
				else
				{
					timer = new InternalTimer( args.Mobile, soundID, interval );
					timer.Start();

					m_Table.Add( soundID, timer );
				}
			}
			else
			{
				args.Mobile.SendMessage( "Usage: RepeatSound <int soundID> <double intervalDelay>" );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:33,代码来源:RepeatSoundCommand.cs

示例3: SetAllSkills_OnCommand

		public static void SetAllSkills_OnCommand( CommandEventArgs arg )
		{
			if( arg.Length != 1 )
			{
				arg.Mobile.SendMessage( "SetAllSkills <value>" );
			}
			else
			{
				arg.Mobile.Target = new AllSkillsTarget( arg.GetDouble( 0 ) );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:11,代码来源:Skills.cs

示例4: SetSkill_OnCommand

		public static void SetSkill_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkill <skill name> <value>" );
			}
			else
			{
				SkillName skill;
				if( Enum.TryParse( arg.GetString( 0 ), true, out skill ) )
				{
					arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
				}
				else
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
				}
			}
		}
开发者ID:nathanvy,项目名称:runuo,代码行数:19,代码来源:Skills.cs

示例5: SetSkill_OnCommand

		public static void SetSkill_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkill <skill name> <value>" );
			}
			else
			{
				SkillName skill;
				try
				{
					skill = (SkillName)Enum.Parse( typeof( SkillName ), arg.GetString( 0 ), true );
				}
				catch
				{
					arg.Mobile.SendLocalizedMessage( 1005631 );
					return;
				}
				arg.Mobile.Target = new SkillTarget( skill, arg.GetDouble( 1 ) );
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:21,代码来源:Skills.cs

示例6: SetSkillP_OnCommand

		public static void SetSkillP_OnCommand( CommandEventArgs arg )
		{
			if ( arg.Length != 2 )
			{
				arg.Mobile.SendMessage( "SetSkillP <skill name> <value>" );
			}
			else
			{
				string skill;
				int which = 0;
				try
				{
					skill =  arg.GetString( 0 );
					for( int i = 0; i < SkillInfo.Table.Length; i++ )
					{
						if( skill == SkillInfo.Table[i].Name )
						{
							which = i;
						}
					}
				}
				catch
				{
					arg.Mobile.SendLocalizedMessage( 1005631 ); // You have specified an invalid skill to set.
					return;
				}
				arg.Mobile.Target = new SkillTargetP( which, arg.GetDouble( 1 ) );
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:29,代码来源:ParallelSkills.cs


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