本文整理汇总了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);
}