当前位置: 首页>>代码示例>>C#>>正文


C# CommandEventArgs.GetInt32方法代码示例

本文整理汇总了C#中CommandEventArgs.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# CommandEventArgs.GetInt32方法的具体用法?C# CommandEventArgs.GetInt32怎么用?C# CommandEventArgs.GetInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommandEventArgs的用法示例。


在下文中一共展示了CommandEventArgs.GetInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:notsentient,项目名称:RunZHA,代码行数:11,代码来源:Handlers.cs

示例2: Anim_OnCommand

 public static void Anim_OnCommand(CommandEventArgs e)
 {
     if (e.Length == 1)
         e.Mobile.Animate(e.GetInt32(0), 5, 1, true, false, 1);
     else
         e.Mobile.SendMessage("Format: Anim <action>");
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:7,代码来源:SpecialEmotes.cs

示例3: Execute

        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            PlayerMobile target = obj as PlayerMobile;

            if (target != null)
            {
                if (e.Length != 1)
                {
                    e.Mobile.SendAsciiMessage("Format:");
                    e.Mobile.SendAsciiMessage("Squelch int minutes");
                    return;
                }

                if (target.CurrentSquelchTimer != null)
                {
                    target.CurrentSquelchTimer.Stop();
                    target.CurrentSquelchTimer = null;
                }

                target.Squelched = true;
                int index = e.GetInt32(0);
                from.SendAsciiMessage("You squelched {0} for {1} minute{2}", target.Name, index, index == 1 ? "" : "s");
                target.SendAsciiMessage("You have been squelched for {0} minute{1}", index, index == 1 ? "" : "s");
                new SquelchDelayTimer(target, TimeSpan.FromMinutes(index)).Start();
            }
            else
                from.SendAsciiMessage("This only works on players!");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:29,代码来源:Squelch.cs

示例4: RepeatSoundCommand_OnCommand

		public static void RepeatSoundCommand_OnCommand( CommandEventArgs args )
		{
			if( args.Length == 2 )
			{
				Timer timer = null;
				bool foundValue = false;
				int soundID = args.GetInt32( 0 );
				double interval = args.GetDouble( 1 );

				if( m_Table.ContainsKey( soundID ) )
					foundValue = m_Table.TryGetValue( soundID, out timer );

				if( foundValue || timer != null )
				{
					if( timer != null )
						timer.Stop();

					if( m_Table.Remove( soundID ) )
						args.Mobile.SendMessage( "RepeatSound process with sound index {0} halted.", soundID );
				}
				else
				{
					timer = new InternalTimer( args.Mobile, soundID, interval );
					timer.Start();

					m_Table.Add( soundID, timer );
				}
			}
			else
			{
				args.Mobile.SendMessage( "Usage: RepeatSound <int soundID> <double intervalDelay>" );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:33,代码来源:RepeatSoundCommand.cs

示例5: SetSay_OnCommand

        private static void SetSay_OnCommand( CommandEventArgs e )
        {
            Mobile m_Mobile = e.Mobile;
            int languageIndex = Language.CommonLanguageIndex;
            if ( e.Length >= 1 )
                languageIndex = e.GetInt32( 0 );
            if (languageIndex >= 11)
            {
                m_Mobile.SendMessage("Podales nieprawidlowa wartosc jezyka");
                return;
            }
            //LanguageKnowledge Lkl = new LanguageKnowledge();
            if (m_Mobile.AccessLevel <= AccessLevel.GameMaster)
            {
                if (m_Mobile.Race.LanguageKnowledgeValue(languageIndex) == 0)
                {
                    m_Mobile.SendMessage("Nie znasz tego jezyka");
                    return;
                }
            }

            if (languageIndex == 0 || Server.Language.Languages[languageIndex] == null)
            {
                m_Mobile.SendMessage("Podales nieprawidlowa wartosc jezyka");
                return;
            }

                m_Mobile.ActualLanguage = languageIndex;

            m_Mobile.SendMessage( "Teraz mowisz w {0}.", Server.Language.Languages[languageIndex].Name );
        }
开发者ID:Telm,项目名称:RunUO_EME,代码行数:31,代码来源:SetSay.cs

示例6: AddBountyCommand_OnCommand

		private static void AddBountyCommand_OnCommand( CommandEventArgs e )
		{
			int amount = 1;
			if ( e.Length >= 1 )
				amount = e.GetInt32( 0 );
			e.Mobile.Target = new InternalTarget( amount > 0 ? amount : 1 );
			e.Mobile.SendMessage( "Who should have a bounty on his head?" );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:8,代码来源:AddBounty.cs

示例7: DupeMob_OnCommand

		private static void DupeMob_OnCommand( CommandEventArgs e )
		{
			int amount = 1;
			if ( e.Length >= 1 )
				amount = e.GetInt32( 0 );
			e.Mobile.Target = new DupeTarget();
			e.Mobile.SendMessage( "What do you wish to dupe?" );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:8,代码来源:dupemob.cs

示例8: NudgeSelfUp_OnCommand

		private static void NudgeSelfUp_OnCommand( CommandEventArgs e )
		{
			if(e.Arguments.Length > 0)
			{
				int zoffset = e.GetInt32(0);
				e.Mobile.Location = new Point3D(e.Mobile.Location, e.Mobile.Location.Z + zoffset);
			}
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:8,代码来源:ClientCommands.cs

示例9: RandomTalisman_OnCommand

		public static void RandomTalisman_OnCommand( CommandEventArgs e )
		{
			Mobile m = e.Mobile;
			int count = e.GetInt32( 0 );

			for ( int i = 0; i < count; i++ )
			{
				m.AddToBackpack( Loot.RandomTalisman() );
			}
		}
开发者ID:PepeBiondi,项目名称:runsa,代码行数:10,代码来源:BaseTalisman.cs

示例10: DupeInBag_OnCommand

        private static void DupeInBag_OnCommand( CommandEventArgs e )
        {
            int amount = 1;
            if ( e.Length >= 1 )
            {
                amount = e.GetInt32( 0 );
            }

            e.Mobile.Target = new DupeTarget( true, amount > 0 ? amount : 1 );
            e.Mobile.SendMessage( "What do you wish to dupe?" );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:11,代码来源:Dupe.cs

示例11: Execute

        public override void Execute(CommandEventArgs e, object obj)
        {
            Mobile from = e.Mobile;
            Mobile target = obj as Mobile;
            Map map = from.Map;
            Point3D location = Point3D.Zero;

            if (target == null || map == Map.Internal || map == null)
            {
                from.SendAsciiMessage("Invalid target.");
                return;
            }
            else if (e.Length == 0)
            {
                from.SendAsciiMessage("Format:");
                from.SendAsciiMessage("SendTo int x int y");
                from.SendAsciiMessage("SendTo int x int y int z");
                from.SendAsciiMessage("SendTo int yLat int yMins (N|S) ySount int xLong int xMins (E|W) xEast");
                return;
            }
            else if (e.Length == 2)
            {
                int x = e.GetInt32(0);
                int y = e.GetInt32(1);

                location = new Point3D(x, y, map.GetAverageZ(x, y));
            }
            else if (e.Length == 3)
                location = new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(2));
            else if (e.Length == 6)
            {
                location = Sextant.ReverseLookup(map, e.GetInt32(3), e.GetInt32(0), e.GetInt32(4), e.GetInt32(1), Insensitive.Equals(e.GetString(5), "E"), Insensitive.Equals(e.GetString(2), "S"));

                if (location == Point3D.Zero)
                    from.SendMessage("Sextant reverse lookup failed.");
            }

            if (location != Point3D.Zero)
            {
                target.MoveToWorld(location, map);
                from.SendAsciiMessage(string.Format("Sent {0} to {1}.", target.Name, location));
            }
            else
                from.SendAsciiMessage("Invalid location.");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:45,代码来源:SendTo.cs

示例12: Light_OnCommand

		private static void Light_OnCommand( CommandEventArgs e )
		{
			if ( e.Length >= 1 )
			{
				LevelOverride = e.GetInt32( 0 );
				e.Mobile.SendMessage( "Global light level override has been changed to {0}.", m_LevelOverride );
			}
			else
			{
				LevelOverride = int.MinValue;
				e.Mobile.SendMessage( "Global light level override has been cleared." );
			}
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:13,代码来源:LightCycle.cs

示例13: DupeMS_OnCommand

        public static void DupeMS_OnCommand( CommandEventArgs e )
        {
            Mobile from = e.Mobile;
            int count = 1;

            try
            {
                count = e.GetInt32( 0 );
            }
            catch{}

            if( count <= 0 )
                count = 1;

            from.Target = new InternalTarget( count );
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:16,代码来源:DupeSpawner.cs

示例14: Execute

        public override void Execute(CommandEventArgs e)
        {
            if (e.Length >= 2)
            {
                Serial serial = e.GetInt32(0);

                object obj = null;

                if (serial.IsItem)
                    obj = World.FindItem(serial);
                else if (serial.IsMobile)
                    obj = World.FindMobile(serial);

                if (obj == null)
                {
                    e.Mobile.SendMessage("That is not a valid serial.");
                }
                else
                {
                    BaseCommand command = null;
                    Commands.TryGetValue(e.GetString(1), out command);

                    if (command == null)
                    {
                        e.Mobile.SendMessage("That is either an invalid command name or one that does not support this modifier.");
                    }
                    else if (e.Mobile.AccessLevel < command.AccessLevel)
                    {
                        e.Mobile.SendMessage("You do not have access to that command.");
                    }
                    else
                    {
                        string[] oldArgs = e.Arguments;
                        string[] args = new string[oldArgs.Length - 2];

                        for (int i = 0; i < args.Length; ++i)
                            args[i] = oldArgs[i + 2];

                        RunCommand(e.Mobile, obj, command, args);
                    }
                }
            }
            else
            {
                e.Mobile.SendMessage("You must supply an object serial and a command name.");
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:47,代码来源:SerialCommandImplementor.cs

示例15: Props_OnCommand

		private static void Props_OnCommand( CommandEventArgs e )
		{
			if ( e.Length == 1 )
			{
				IEntity ent = World.FindEntity( e.GetInt32( 0 ) );

				if ( ent == null )
					e.Mobile.SendMessage( "No object with that serial was found." );
				else if ( !BaseCommand.IsAccessible( e.Mobile, ent ) )
					e.Mobile.SendMessage( "That is not accessible." );
				else
					e.Mobile.SendGump( new PropertiesGump( e.Mobile, ent ) );
			}
			else
			{
				e.Mobile.Target = new PropsTarget();
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:18,代码来源:Properties.cs


注:本文中的CommandEventArgs.GetInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。