当前位置: 首页>>代码示例>>C#>>正文


C# Item.OnRemoved方法代码示例

本文整理汇总了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 );
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:20,代码来源:Item.cs

示例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();
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:27,代码来源:Mobile.cs

示例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 );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:27,代码来源:Item.cs

示例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();
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:34,代码来源:Mobile.cs

示例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);
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:22,代码来源:Item.cs


注:本文中的Server.Item.OnRemoved方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。