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