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


C# Generic.BaseCommand類代碼示例

本文整理匯總了C#中Server.Commands.Generic.BaseCommand的典型用法代碼示例。如果您正苦於以下問題:C# BaseCommand類的具體用法?C# BaseCommand怎麽用?C# BaseCommand使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseCommand類屬於Server.Commands.Generic命名空間,在下文中一共展示了BaseCommand類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Compile

		public override void Compile( Mobile from, BaseCommand command, ref string[] args, ref object obj )
		{
			if ( command.ObjectTypes == ObjectTypes.Items )
				return; // sanity check

			obj = from;
		}
開發者ID:Godkong,項目名稱:Origins,代碼行數:7,代碼來源:SelfCommandImplementor.cs

示例2: Register

		public override void Register( BaseCommand command )
		{
			base.Register( command );

			for ( int i = 0; i < command.Commands.Length; ++i )
				CommandSystem.Register( command.Commands[i], command.AccessLevel, new CommandEventHandler( Redirect ) );
		}
開發者ID:greeduomacro,項目名稱:unknown-shard-1,代碼行數:7,代碼來源:SingleCommandImplementor.cs

示例3: Process

		public override void Process( Mobile from, BaseCommand command, string[] args )
		{
			RangeCommandImplementor impl = RangeCommandImplementor.Instance;

			if ( impl == null )
				return;

			impl.Process( 18, from, command, args );
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:9,代碼來源:ScreenCommandImplementor.cs

示例4: Register

		public static void Register( BaseCommand command )
		{
			m_AllCommands.Add( command );

			List<BaseCommandImplementor> impls = BaseCommandImplementor.Implementors;

			for ( int i = 0; i < impls.Count; ++i )
			{
				BaseCommandImplementor impl = impls[i];

				if ( (command.Supports & impl.SupportRequirement) != 0 )
					impl.Register( command );
			}
		}
開發者ID:romeov007,項目名稱:imagine-uo,代碼行數:14,代碼來源:Commands.cs

示例5: Process

        public override void Process(Mobile from, BaseCommand command, string[] args)
        {
            AreaCommandImplementor impl = AreaCommandImplementor.Instance;

            if (impl == null)
                return;

            Map map = from.Map;

            if (map == null || map == Map.Internal)
                return;

            impl.OnTarget(from, map, Point3D.Zero, new Point3D(map.Width - 1, map.Height - 1, 0), new object[] { command, args });
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:14,代碼來源:FacetCommandImplementor.cs

示例6: Process

		public void Process( int range, Mobile from, BaseCommand command, string[] args )
		{
			AreaCommandImplementor impl = AreaCommandImplementor.Instance;

			if ( impl == null )
				return;

			Map map = from.Map;

			if ( map == null || map == Map.Internal )
				return;

			Point3D start = new Point3D( from.X - range, from.Y - range, from.Z );
			Point3D end = new Point3D( from.X + range, from.Y + range, from.Z );

			impl.OnTarget( from, map, start, end, new object[] { command, args } );
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:17,代碼來源:RangeCommandImplementor.cs

示例7: Compile

        public override void Compile(Mobile from, BaseCommand command, ref string[] args, ref object obj)
        {
            try
            {
                Extensions ext = Extensions.Parse(from, ref args);

                bool items, mobiles;

                if (!this.CheckObjectTypes(from, command, ext, out items, out mobiles))
                    return;

                if (!mobiles) // sanity check
                {
                    command.LogFailure("This command does not support items.");
                    return;
                }

                ArrayList list = new ArrayList();

                List<NetState> states = NetState.Instances;

                for (int i = 0; i < states.Count; ++i)
                {
                    NetState ns = states[i];
                    Mobile mob = ns.Mobile;

                    if (mob == null)
                        continue;

                    if (!BaseCommand.IsAccessible(from, mob))
                        continue;

                    if (ext.IsValid(mob))
                        list.Add(mob);
                }

                ext.Filter(list);

                obj = list;
            }
            catch (Exception ex)
            {
                from.SendMessage(ex.Message);
            }
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:45,代碼來源:OnlineCommandImplementor.cs

示例8: Compile

		public override void Compile( Mobile from, BaseCommand command, ref string[] args, ref object obj )
		{
			try
			{
				if (LoggingCustom.CommandDebug)
					LoggingCustom.LogCommandDebug("Global...compiling\t");
                Extensions ext = Extensions.Parse( from, ref args );

				bool items, mobiles;
                if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "1\t");
				if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) )
					return;

				ArrayList list = new ArrayList();

				if ( items )
				{
                    if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "2\t");
                    foreach ( Item item in World.Items.Values )
					{
						if ( ext.IsValid( item ) )
							list.Add( item );
					}
				}

				if ( mobiles )
				{
                    if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "3\t");
                    foreach ( Mobile mob in World.Mobiles.Values )
					{
						if ( ext.IsValid( mob ) )
							list.Add( mob );
					}
				}
                if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "startfilter:list with " + list.Count+ " in it\t");
				ext.Filter( list );
                if (LoggingCustom.CommandDebug) LoggingCustom.LogCommandDebug( "4\t");
				obj = list;
			}
			catch ( Exception ex )
			{
				from.SendMessage( ex.Message );
			}
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:44,代碼來源:GlobalCommandImplementor.cs

示例9: Compile

		public override void Compile( Mobile from, BaseCommand command, ref string[] args, ref object obj )
		{
			try
			{
				Extensions ext = Extensions.Parse( from, ref args );

				bool items, mobiles;

				if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) )
					return;

				if ( !mobiles ) // sanity check
				{
					command.LogFailure( "This command does not support items." );
					return;
				}

				ArrayList list = new ArrayList();
				ArrayList addresses = new ArrayList();

				System.Collections.Generic.List<NetState> states = NetState.Instances;

				for ( int i = 0; i < states.Count; ++i )
				{
					NetState ns = (NetState)states[i];
					Mobile mob = ns.Mobile;

					if ( mob != null && !addresses.Contains( ns.Address ) && ext.IsValid( mob ) )
					{
						list.Add( mob );
						addresses.Add( ns.Address );
					}
				}

				ext.Filter( list );

				obj = list;
			}
			catch ( Exception ex )
			{
				from.SendMessage( ex.Message );
			}
		}
開發者ID:greeduomacro,項目名稱:last-wish,代碼行數:43,代碼來源:IPAddressCommandImplementor.cs

示例10: Compile

		public override void Compile( Mobile from, BaseCommand command, ref string[] args, ref object obj )
		{
			try
			{
				Extensions ext = Extensions.Parse( from, ref args );

				bool items, mobiles;

				if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) )
					return;

				Region reg = from.Region;

				ArrayList list = new ArrayList();

				if ( mobiles )
				{
					foreach ( Mobile mob in reg.GetMobiles() )
					{
						if( !BaseCommand.IsAccessible( from, mob ) )
							continue;

						if ( ext.IsValid( mob ) )
							list.Add( mob );
					}
				}
				else
				{
					command.LogFailure( "This command does not support items." );
					return;
				}

				ext.Filter( list );

				obj = list;
			}
			catch ( Exception ex )
			{
				from.SendMessage( ex.Message );
			}
		}
開發者ID:nathanvy,項目名稱:runuo,代碼行數:41,代碼來源:RegionCommandImplementor.cs

示例11: Compile

		public override void Compile( Mobile from, BaseCommand command, ref string[] args, ref object obj )
		{
			try
			{
				Extensions ext = Extensions.Parse( from, ref args );

				bool items, mobiles;

				if ( !CheckObjectTypes( from, command, ext, out items, out mobiles ) )
					return;

				ArrayList list = new ArrayList();

				if ( items )
				{
					foreach ( Item item in World.Items.Values )
					{
						if ( ext.IsValid( item ) )
							list.Add( item );
					}
				}

				if ( mobiles )
				{
					foreach ( Mobile mob in World.Mobiles.Values )
					{
						if ( ext.IsValid( mob ) )
							list.Add( mob );
					}
				}

				ext.Filter( list );

				obj = list;
			}
			catch ( Exception ex )
			{
				from.SendMessage( ex.Message );
			}
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:40,代碼來源:GlobalCommandImplementor.cs

示例12: RunCommand

		public void RunCommand( Mobile from, object obj, BaseCommand command, string[] args )
		{
		//	try
		//	{
				CommandEventArgs e = new CommandEventArgs( from, command.Commands[0], GenerateArgString( args ), args );

				if ( !command.ValidateArgs( this, e ) )
					return;

				bool flushToLog = false;

				if ( obj is ArrayList )
				{
					ArrayList list = (ArrayList)obj;

					if ( list.Count > 20 )
						CommandLogging.Enabled = false;
					else if ( list.Count == 0 )
						command.LogFailure( "Nothing was found to use this command on." );

					command.ExecuteList( e, list );

					if ( list.Count > 20 )
					{
						flushToLog = true;
						CommandLogging.Enabled = true;
					}
				}
				else if ( obj != null )
				{
					if ( command.ListOptimized )
					{
						ArrayList list = new ArrayList();
						list.Add( obj );
						command.ExecuteList( e, list );
					}
					else
					{
						command.Execute( e, obj );
					}
				}

				command.Flush( from, flushToLog );
		//	}
		//	catch ( Exception ex )
		//	{
		//		from.SendMessage( ex.Message );
		//	}
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:49,代碼來源:BaseCommandImplementor.cs

示例13: Process

		public override void Process( Mobile from, BaseCommand command, string[] args )
		{
			BoundingBoxPicker.Begin( from, new BoundingBoxCallback( OnTarget ), new object[]{ command, args } );
		}
開發者ID:jackuoll,項目名稱:Pre-AOS-RunUO,代碼行數:4,代碼來源:AreaCommandImplementor.cs

示例14: Process

		public override void Process( Mobile from, BaseCommand command, string[] args )
		{
			if ( command.ValidateArgs( this, new CommandEventArgs( from, command.Commands[0], GenerateArgString( args ), args ) ) )
				from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
		}
開發者ID:Godkong,項目名稱:Origins,代碼行數:5,代碼來源:ContainedCommandImplementor.cs

示例15: Register

		public virtual void Register( BaseCommand command )
		{
			for ( int i = 0; i < command.Commands.Length; ++i )
				m_Commands[command.Commands[i]] = command;
		}
開發者ID:FreeReign,項目名稱:imaginenation,代碼行數:5,代碼來源:BaseCommandImplementor.cs


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