本文整理汇总了C#中Server.Item.OnRemoved方法的典型用法代码示例。如果您正苦于以下问题:C# Item.OnRemoved方法的具体用法?C# Item.OnRemoved怎么用?C# Item.OnRemoved使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Item
的用法示例。
在下文中一共展示了Item.OnRemoved方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveItem
public virtual void RemoveItem( Item item )
{
if ( m_Items != null && m_Items.Contains( item ) )
{
item.SendRemovePacket();
int oldCount = m_Items.Count;
m_Items.Remove( item );
TotalItems = (TotalItems - oldCount) + m_Items.Count - item.TotalItems + (item.IsVirtualItem ? 1 : 0);
TotalWeight -= item.TotalWeight + item.PileWeight;
TotalGold -= item.TotalGold;
item.Parent = null;
item.OnRemoved( this );
OnItemRemoved( item );
}
}
示例2: RemoveItem
public void RemoveItem( Item item )
{
if ( item == null || m_Items == null )
return;
if ( m_Items.Contains( item ) )
{
item.SendRemovePacket();
m_Items.Remove( item );
if ( !(item is BankBox) )
{
TotalWeight -= item.TotalWeight + item.PileWeight;
TotalGold -= item.TotalGold;
}
item.Parent = null;
item.OnRemoved( this );
OnItemRemoved( item );
if ( item.PhysicalResistance != 0 || item.FireResistance != 0 || item.ColdResistance != 0 ||
item.PoisonResistance != 0 || item.EnergyResistance != 0 )
UpdateResistances();
}
}
示例3: RemoveItem
public virtual void RemoveItem( Item item )
{
if ( m_Items != null && m_Items.Contains( item ) )
{
item.SendRemovePacket();
int oldCount = m_Items.Count;
m_Items.Remove( item );
TotalItems = ( TotalItems - oldCount ) + m_Items.Count - item.TotalItems + ( item.IsVirtualItem ? 1 : 0 );
TotalWeight -= item.TotalWeight + item.PileWeight;
if ( !( item is Container && ( (Container) item ).UseLockedRestriction && ( (Container) item ).IsLockedContainer ) )
{
if ( ( TotalGold - item.TotalGold ) > 0 )
TotalGold -= item.TotalGold;
else
TotalGold = 0;
}
item.Parent = null;
item.OnRemoved( this );
OnItemRemoved( item );
}
}
示例4: RemoveItem
public void RemoveItem( Item item )
{
if ( item == null || m_EquippedItems == null )
return;
if ( m_EquippedItems.Contains( item ) )
{
item.SendRemovePacket();
m_EquippedItems.Remove( item );
if ( !( item is BankBox ) )
{
TotalWeight -= item.TotalWeight + item.PileWeight;
if ( !( item is Container && ( (Container) item ).UseLockedRestriction && ( (Container) item ).IsLockedContainer ) )
{
if ( ( TotalGold - item.TotalGold ) > 0 )
TotalGold -= item.TotalGold;
else
TotalGold = 0;
}
}
item.Parent = null;
item.OnRemoved( this );
OnItemRemoved( item );
if ( item.PhysicalResistance != 0 || item.FireResistance != 0 || item.ColdResistance != 0 ||
item.PoisonResistance != 0 || item.EnergyResistance != 0 )
UpdateResistances();
}
}
示例5: RemoveItem
public virtual void RemoveItem(Item item) // needs FreezeDried modifications
{
CheckRehydrate();
if (m_Items != null && m_Items.Contains(item))
{
item.SendRemovePacket();
int oldCount = m_Items.Count;
m_Items.Remove(item);
TotalItems = (TotalItems - oldCount) + m_Items.Count - item.TotalItems + (item.IsVirtualItem ? 1 : 0);
TotalWeight -= item.TotalWeight + item.PileWeight;
TotalGold -= item.TotalGold;
item.Parent = null;
item.OnRemoved(this);
OnItemRemoved(item);
}
}