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


C# BaseDoor.Delete方法代碼示例

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


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

示例1: ConvertDoor

        protected void ConvertDoor(BaseDoor door)
        {
            if (!Owned)
            {
                return;
            }

            if (door is ISecurable)
            {
                door.Locked = false;
                c_House.Doors.Add(door);
                return;
            }

            door.Open = false;

            var newdoor = new GenericHouseDoor(0, door.ClosedID, door.OpenedSound, door.ClosedSound)
            {
                Offset = door.Offset,
                ClosedID = door.ClosedID,
                OpenedID = door.OpenedID,
                Location = door.Location,
                Map = door.Map
            };

            door.Delete();

            foreach (
                Item inneritem in
                    newdoor.GetItemsInRange(1)
                        .Where(inneritem => inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z))
            {
                ((BaseDoor) inneritem).Link = newdoor;
                newdoor.Link = (BaseDoor) inneritem;
            }

            c_House.Doors.Add(newdoor);
        }
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:38,代碼來源:TownHouseSign.cs

示例2: ConvertDoor

		protected void ConvertDoor( BaseDoor door )
		{
			if ( !Owned )
				return;

			if ( door is Server.Gumps.ISecurable )
			{
                Console.WriteLine("Convert Door 1");
				door.Locked = false;
				c_House.Doors.Add( door );
                return;
			}

			door.Open = false;

			GenericHouseDoor newdoor = new GenericHouseDoor( (DoorFacing)0, door.ClosedID, door.OpenedSound, door.ClosedSound );
			newdoor.Offset = door.Offset;
			newdoor.ClosedID = door.ClosedID;
			newdoor.OpenedID = door.OpenedID;
			newdoor.Location = door.Location;
			newdoor.Map = door.Map;

			door.Delete();

			foreach( Item inneritem in newdoor.GetItemsInRange( 1 ) )
				if ( inneritem is BaseDoor && inneritem != newdoor && inneritem.Z == newdoor.Z )
				{
					((BaseDoor)inneritem).Link = newdoor;
					newdoor.Link = (BaseDoor)inneritem;
				}

            Console.WriteLine("Convert Door 2");
            c_House.Doors.Add(newdoor);
        }
開發者ID:greeduomacro,項目名稱:annox,代碼行數:34,代碼來源:TownHouseSign.cs


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