本文整理汇总了C#中Server.Commands.CommandEventArgs.GetDouble方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs.GetDouble方法的具体用法?C# CommandEventArgs.GetDouble怎么用?C# CommandEventArgs.GetDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Commands.CommandEventArgs
的用法示例。
在下文中一共展示了CommandEventArgs.GetDouble方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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 ) );
}
}
示例3: 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.
}
}
}