本文整理汇总了C#中Server.Commands.CommandEventArgs.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs.GetBoolean方法的具体用法?C# CommandEventArgs.GetBoolean怎么用?C# CommandEventArgs.GetBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Commands.CommandEventArgs
的用法示例。
在下文中一共展示了CommandEventArgs.GetBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Animate_OnCommand
public static void Animate_OnCommand(CommandEventArgs e)
{
if (e.Length == 6)
{
e.Mobile.Animate(e.GetInt32(0), e.GetInt32(1), e.GetInt32(2), e.GetBoolean(3), e.GetBoolean(4), e.GetInt32(5));
}
else
{
e.Mobile.SendMessage("Format: Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>");
}
}
示例2: SetGuarded_OnCommand
private static void SetGuarded_OnCommand( CommandEventArgs e )
{
Mobile from = e.Mobile;
if ( e.Length == 1 )
{
GuardedRegion reg = (GuardedRegion) from.Region.GetRegion( typeof( GuardedRegion ) );
if ( reg == null )
{
from.SendMessage( "You are not in a guardable region." );
}
else
{
reg.Disabled = !e.GetBoolean( 0 );
if ( reg.Disabled )
from.SendMessage( "The guards in this region have been disabled." );
else
from.SendMessage( "The guards in this region have been enabled." );
}
}
else
{
from.SendMessage( "Format: SetGuarded <true|false>" );
}
}
示例3: SetProfiles_OnCommand
public static void SetProfiles_OnCommand(CommandEventArgs e)
{
if (e.Length == 1)
Core.Profiling = e.GetBoolean(0);
else
Core.Profiling = !Core.Profiling;
e.Mobile.SendMessage("Profiling has been {0}.", Core.Profiling ? "enabled" : "disabled");
}
示例4: SetSaves_OnCommand
public static void SetSaves_OnCommand(CommandEventArgs e)
{
if (e.Length == 1)
{
m_SavesEnabled = e.GetBoolean(0);
e.Mobile.SendMessage("Saves have been {0}.", m_SavesEnabled ? "enabled" : "disabled");
}
else
{
e.Mobile.SendMessage("Format: SetSaves <true | false>");
}
}
示例5: SpeedBoost_OnCommand
private static void SpeedBoost_OnCommand(CommandEventArgs e)
{
Mobile from = e.Mobile;
if (e.Length <= 1)
{
if (e.Length == 1 && !e.GetBoolean(0))
{
from.Send(SpeedControl.Disable);
from.SendMessage("Speed boost has been disabled.");
}
else
{
from.Send(SpeedControl.MountSpeed);
from.SendMessage("Speed boost has been enabled.");
}
}
else
{
from.SendMessage("Format: SpeedBoost [true|false]");
}
}
示例6: Sound_OnCommand
public static void Sound_OnCommand(CommandEventArgs e)
{
if (e.Length == 1)
PlaySound(e.Mobile, e.GetInt32(0), true);
else if (e.Length == 2)
PlaySound(e.Mobile, e.GetInt32(0), e.GetBoolean(1));
else
e.Mobile.SendMessage("Format: Sound <index> [toAll]");
}
示例7: SaveAllQuests_OnCommand
public static void SaveAllQuests_OnCommand( CommandEventArgs e )
{
Mobile m = e.Mobile;
if ( e.Length > 1 )
{
m.SendMessage( "Syntax: SaveAllQuests [saveEnabled=true]" );
return;
}
bool enable = ( e.Length == 1 ) ? e.GetBoolean( 0 ) : true;
foreach ( MLQuest quest in m_Quests.Values )
quest.SaveEnabled = enable;
m.SendMessage( "Serialization for all quests is now {0}.", enable ? "enabled" : "disabled" );
if ( AutoGenerateNew && !enable )
m.SendMessage( "Please note that automatic generation of new quests is ON. All quests will be regenerated on the next server start." );
}
示例8: SaveQuest_OnCommand
public static void SaveQuest_OnCommand( CommandEventArgs e )
{
Mobile m = e.Mobile;
if ( e.Length == 0 || e.Length > 2 )
{
m.SendMessage( "Syntax: SaveQuest <id> [saveEnabled=true]" );
return;
}
Type index = ScriptCompiler.FindTypeByName( e.GetString( 0 ) );
MLQuest quest;
if ( index == null || !m_Quests.TryGetValue( index, out quest ) )
{
m.SendMessage( "Invalid quest type name." );
return;
}
bool enable = ( e.Length == 2 ) ? e.GetBoolean( 1 ) : true;
quest.SaveEnabled = enable;
m.SendMessage( "Serialization for quest {0} is now {1}.", quest.GetType().Name, enable ? "enabled" : "disabled" );
if ( AutoGenerateNew && !enable )
m.SendMessage( "Please note that automatic generation of new quests is ON. This quest will be regenerated on the next server start." );
}
示例9: Unhide_OnCommand
public static void Unhide_OnCommand( CommandEventArgs e )
{
if( e.Arguments.Length == 1 )
{
e.Mobile.Target = new SetHiddenTarget( false, e.GetBoolean( 0 ) );
}
else
{
e.Mobile.Target = new SetHiddenTarget( false, true );
e.Mobile.SendMessage( "Usage: Unhide <bool effects>\nUnhiding with effects anyway..." );
}
}