当前位置: 首页>>代码示例>>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;未经允许,请勿转载。