當前位置: 首頁>>代碼示例>>C#>>正文


C# CommandEventArgs.GetBoolean方法代碼示例

本文整理匯總了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>");
     }
 }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:11,代碼來源:Handlers.cs

示例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>" );
			}
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:27,代碼來源:GuardedRegion.cs

示例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");
        }
開發者ID:m309,項目名稱:ForkUO,代碼行數:9,代碼來源:Profiling.cs

示例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>");
     }
 }
開發者ID:aj9251,項目名稱:ServUO,代碼行數:12,代碼來源:AutoSave.cs

示例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]");
            }
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:22,代碼來源:Handlers.cs

示例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]");
 }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:9,代碼來源:Handlers.cs

示例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." );
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:20,代碼來源:MLQuestSystem.cs

示例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." );
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:27,代碼來源:MLQuestSystem.cs

示例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..." );
			}
		}
開發者ID:greeduomacro,項目名稱:hubroot,代碼行數:12,代碼來源:Handlers.cs


注:本文中的Server.Commands.CommandEventArgs.GetBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。