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