本文整理汇总了C#中Server.CommandEventArgs.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs.GetBoolean方法的具体用法?C# CommandEventArgs.GetBoolean怎么用?C# CommandEventArgs.GetBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.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 = from.Region as 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: 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>" );
}
}
示例4: 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]");
}
示例5: 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");
}
示例6: ExecuteList
public override void ExecuteList( CommandEventArgs e, ArrayList list )
{
e.Mobile.SendGump( new WarningGump( 1060637, 30720, String.Format( "You are about to insert {0} objects. This cannot be undone without a full server revert.<br><br>Continue?", list.Count ), 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[] { e, list, ( e.Length < 1 || !e.GetBoolean( 0 ) ) } ) );
AddResponse( "Awaiting confirmation..." );
}
示例7: Execute
public override void Execute( CommandEventArgs e, object obj )
{
Target t = new DesignInsertTarget( new List<HouseFoundation>(), ( e.Length < 1 || !e.GetBoolean( 0 ) ) );
t.Invoke( e.Mobile, obj );
}
示例8: ScheduleServerRestart_OnCommand
private static void ScheduleServerRestart_OnCommand(CommandEventArgs e)
{
if (e.Length == 1)
{
if (e.GetBoolean(0))
{
m_RestartTime = DateTime.Now.Date + RestartTime;
if (m_RestartTime < DateTime.Now) m_RestartTime += TimeSpan.FromDays(1.0);
e.Mobile.SendMessage("A server restart has been scheduled for {0} {1}.", m_RestartTime.ToLongDateString(), m_RestartTime.ToLongTimeString());
}
else
{
CalculateRegularRestartTime();
e.Mobile.SendMessage("The additional restart has been canceled. The server will restart on {0} {1}.", m_RestartTime.ToLongDateString(), m_RestartTime.ToLongTimeString());
}
}
else
e.Mobile.SendMessage("The server will restart on {0} at {1}.", m_RestartTime.ToLongDateString(), m_RestartTime.ToLongTimeString());
}
示例9: SetDonations_OnCommand
public static void SetDonations_OnCommand(CommandEventArgs e)
{
if (e.Length == 1)
{
ms_ClaimDonationsBlocked = !e.GetBoolean(0);//Note: true leads to donations not being blocked!
e.Mobile.SendMessage("Donations have been {0}.", ms_ClaimDonationsBlocked ? "disabled" : "enabled");
e.Mobile.SendMessage("Warning: Donations will be reactivated on server restart!");
}
else
{
e.Mobile.SendMessage("Donations are {0}.", ms_ClaimDonationsBlocked ? "disabled" : "enabled");
e.Mobile.SendMessage("Format: SetDonations <true | false>");
}
}