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


C# LockableContainer.IsAccessibleTo方法代碼示例

本文整理匯總了C#中Server.Items.LockableContainer.IsAccessibleTo方法的典型用法代碼示例。如果您正苦於以下問題:C# LockableContainer.IsAccessibleTo方法的具體用法?C# LockableContainer.IsAccessibleTo怎麽用?C# LockableContainer.IsAccessibleTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Items.LockableContainer的用法示例。


在下文中一共展示了LockableContainer.IsAccessibleTo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Verify

		private int Verify( LockableContainer container )
		{
			if ( container == null || container.KeyValue == 0 )
				return 1005638; // You can only trap lockable chests.
			if ( From.Map != container.Map || !From.InRange( container.GetWorldLocation(), 2 ) )
				return 500446; // That is too far away.
			if ( !container.Movable )
				return 502944; // You cannot trap this item because it is locked down.
			if ( !container.IsAccessibleTo( From ) )
				return 502946; // That belongs to someone else.
			if ( container.Locked )
				return 502943; // You can only trap an unlocked object.
			if ( container.TrapType != TrapType.None )
				return 502945; // You can only place one trap on an object at a time.

			return 0;
		}
開發者ID:greeduomacro,項目名稱:unknown-shard-1,代碼行數:17,代碼來源:DefTinkering.cs

示例2: Verify

        private int Verify( LockableContainer container )
        {
            if (container == null || container.KeyValue == 0)
            {
                From.SendAsciiMessage("You can only trap lockable chests.");
                return 1005638; // You can only trap lockable chests.
            }
            if (From.Map != container.Map || !From.InRange(container.GetWorldLocation(), 2))
            {
                int OldHue = From.SpeechHue;
                From.SpeechHue = 0;
                From.SayTo(From, true, "I can't reach that.");
                From.SpeechHue = OldHue;
                return 500446; // That is too far away.
            }
            if (!container.Movable)
            {
                return 502944; // You cannot trap this item because it is locked down.
            }
            if (!container.IsAccessibleTo(From))
            {
                From.SendAsciiMessage("That belongs to someone else.");
                return 502946; // That belongs to someone else.
            }
            if (container.Locked)
            {
                From.SendAsciiMessage("You can only trap an unlocked object.");
                return 502943; // You can only trap an unlocked object.
            }
            if (container.TrapType != TrapType.None)
            {
                From.SendAsciiMessage("You can only place one trap on an object at a time.");
                return 502945; // You can only place one trap on an object at a time.
            }

            return 0;
        }
開發者ID:Godkong,項目名稱:RunUO,代碼行數:37,代碼來源:DefTinkering.cs


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