本文整理汇总了C#中Server.Items.TrashBarrel.MoveToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# TrashBarrel.MoveToWorld方法的具体用法?C# TrashBarrel.MoveToWorld怎么用?C# TrashBarrel.MoveToWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.TrashBarrel
的用法示例。
在下文中一共展示了TrashBarrel.MoveToWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTrashBarrel
public void AddTrashBarrel( Mobile from )
{
if ( !IsActive )
return;
for ( int i = 0; m_Doors != null && i < m_Doors.Count; ++i )
{
BaseDoor door = m_Doors[i] as BaseDoor;
Point3D p = door.Location;
if ( door.Open )
p = new Point3D( p.X - door.Offset.X, p.Y - door.Offset.Y, p.Z - door.Offset.Z );
if ( (from.Z + 16) >= p.Z && (p.Z + 16) >= from.Z )
{
if ( from.InRange( p, 1 ) )
{
from.SendLocalizedMessage( 502120 ); // You cannot place a trash barrel near a door or near steps.
return;
}
}
}
if ( m_Trash == null || m_Trash.Deleted )
{
m_Trash = new TrashBarrel();
m_Trash.Movable = false;
m_Trash.MoveToWorld( from.Location, from.Map );
from.SendLocalizedMessage( 502121 ); /* You have a new trash barrel.
* Three minutes after you put something in the barrel, the trash will be emptied.
* Be forewarned, this is permanent! */
}
else
{
m_Trash.MoveToWorld( from.Location, from.Map );
}
}