コード例 #1
0
        protected void Dispose()
        {
            if (this.Looters == null)
            {
                return;
            }
            IList <LooterEntry> looters = this.Looters;

            this.Looters = (IList <LooterEntry>)null;
            for (int index = 0; index < looters.Count; ++index)
            {
                LooterEntry looterEntry = looters[index];
                Character   owner       = looterEntry.Owner;
                if (owner != null)
                {
                    LootHandler.SendLootReleaseResponse(owner, this);
                }
                if (looterEntry.Loot == this)
                {
                    looterEntry.Loot = (Loot)null;
                }
            }

            this.OnDispose();
        }
コード例 #2
0
        protected void Dispose()
        {
            if (Looters == null)
            {
                return;
            }

            var looters = Looters;

            Looters = null;

            for (var i = 0; i < looters.Count; i++)
            {
                var looter = looters[i];
                var owner  = looter.Owner;
                if (owner != null)
                {
                    LootHandler.SendLootReleaseResponse(owner, this);
                }

                if (looter.Loot == this)
                {
                    looter.Loot = null;
                }
            }

            OnDispose();
        }
コード例 #3
0
ファイル: LooterEntry.cs プロジェクト: 0xFh/Asda2-Project
 /// <summary>
 /// Releases the current loot and (maybe) makes it available to everyone else.
 /// </summary>
 public void Release()
 {
     if (m_loot == null)
     {
         return;
     }
     if (m_owner != null)
     {
         LootHandler.SendLootReleaseResponse(m_owner, m_loot);
     }
     m_loot.RemoveLooter(this);
     if (m_loot.Looters.Count == 0)
     {
         m_loot.IsReleased = true;
     }
     Loot = null;
 }