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