本文整理匯總了C#中Server.Items.BaseAddon.Delete方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseAddon.Delete方法的具體用法?C# BaseAddon.Delete怎麽用?C# BaseAddon.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Items.BaseAddon
的用法示例。
在下文中一共展示了BaseAddon.Delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnChop
public void OnChop(BaseAddon addon, Mobile from)
{
if (addon == null || from == null || !Contains(addon) || !Contains(from))
return;
Effects.PlaySound(addon.GetWorldLocation(), addon.Map, 0x3B3);
from.SendLocalizedMessage(500461); // You destroy the item.
int hue = 0;
if (addon.RetainDeedHue)
{
for (int i = 0; hue == 0 && i < addon.Components.Count; ++i)
{
AddonComponent c = addon.Components[i];
if (c.Hue != 0)
hue = c.Hue;
}
}
addon.Delete();
RemoveAddon(addon);
BaseAddonDeed deed = addon.Deed;
if (deed != null)
{
#region Mondains Legacy
deed.Resource = addon.Resource;
#endregion
if (addon.RetainDeedHue)
deed.Hue = hue;
from.AddToBackpack(deed);
}
}
示例2: Convert2Static
public void Convert2Static(BaseAddon design)
{
if (design.Components.Count > 0)
{
for (int i = 0; i < design.Components.Count; ++i)
{
AddonComponent component = (AddonComponent)((design.Components)[i]);
Static equivalent = new Static(component.HuedItemID); //( component.ItemID );
equivalent.Location = component.Location; //component.Location;
equivalent.Map = component.Map; //component.Map;
equivalent.Hue = component.Hue; //component.Map;
}
}
design.Delete();
}