本文整理匯總了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);
}
示例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);
}