本文整理汇总了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
}
}
示例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>" );
}
}
示例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 ) );
}
}
示例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.
}
}
}
示例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 ) );
}
}
示例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 ) );
}
}