fix: Prepares for IPooledEnumerable removal (#1548)

### Summary

- Removes `IPooledEnumerable` (non-generic)
- Changes `IPooledEnumerable<T>` so that  `Free()` is replaced with the `IDisposable` pattern
This commit is contained in:
Kamron Batman 2023-10-15 11:20:49 -07:00 • committed by GitHub
parent c2d6578955
commit d57f1fecc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
92 changed files with 644 additions and 907 deletions

View file

@ -55,7 +55,6 @@ namespace Server.Spells.Chivalry
queue.Enqueue(m);
}
}
eable.Free();
while (queue.Count > 0)
{

View file

@ -46,8 +46,6 @@ namespace Server.Spells.Chivalry
}
}
eable.Free();
Caster.PlaySound(0x244);
Caster.FixedParticles(0x3709, 1, 30, 9965, 5, 7, EffectLayer.Waist);
Caster.FixedParticles(0x376A, 1, 30, 9502, 5, 3, EffectLayer.Waist);

View file

@ -262,8 +262,6 @@ namespace Server.Spells.Fifth
}
}
eable.Free();
while (queue.Count > 0)
{
var m = queue.Dequeue();

View file

@ -57,8 +57,6 @@ namespace Server.Spells.Fourth
}
}
eable.Free();
Effects.PlaySound(loc, Caster.Map, 0x299);
var cured = 0;

View file

@ -59,8 +59,6 @@ namespace Server.Spells.Fourth
}
}
eable.Free();
if (Core.AOS)
{
var party = Party.Get(Caster);

View file

@ -47,9 +47,7 @@ namespace Server.Spells.Mysticism
var casterParty = Party.Get(Caster);
if (casterParty != null)
{
IPooledEnumerable eable = Caster.Map.GetMobilesInRange(m.Location, 2);
foreach (Mobile mob in eable)
foreach (Mobile mob in Caster.Map.GetMobilesInRange(m.Location, 2))
{
if (mob == m)
{
@ -65,8 +63,6 @@ namespace Server.Spells.Mysticism
}
}
}
eable.Free();
}
var primarySkill = GetBaseSkill(Caster);

View file

@ -111,8 +111,6 @@ namespace Server.Spells.Necromancy
pool.Enqueue(targ);
}
eable.Free();
while (pool.Count > 0)
{
var targ = pool.Dequeue();

View file

@ -84,8 +84,6 @@ namespace Server.Spells.Necromancy
pool.Enqueue(targ);
}
eable.Free();
Effects.PlaySound(Caster.Location, map, 0x1FB);
Effects.PlaySound(Caster.Location, map, 0x10B);
Effects.SendLocationParticles(

View file

@ -56,8 +56,6 @@ namespace Server.Spells.Seventh
pool.Enqueue(m);
}
eable.Free();
if (pool.Count > 0)
{
double damage = Core.AOS

View file

@ -69,8 +69,6 @@ namespace Server.Spells.Seventh
}
}
eable.Free();
while (queue.Count > 0)
{
queue.Dequeue().Delete();

View file

@ -60,8 +60,6 @@ namespace Server.Spells.Seventh
queue.Enqueue(m);
}
eable.Free();
double damage = Core.AOS
? GetNewAosDamage(51, 1, 5, playerVsPlayer)
: Utility.Random(27, 22);

View file

@ -54,8 +54,6 @@ namespace Server.Spells.Sixth
HarmfulSpell(m);
}
eable.Free();
}
}

View file

@ -53,8 +53,6 @@ namespace Server.Spells.Sixth
m.FixedParticles(0x375A, 9, 20, 5049, EffectLayer.Head);
m.PlaySound(0x1FD);
}
eable.Free();
}
}

View file

@ -103,13 +103,10 @@ namespace Server.Spells.Spellweaving
{
if (item.Z + item.ItemData.CalcHeight == location.Z && IsValidTile(item.ItemID))
{
eable.Free();
return true;
}
}
eable.Free();
return false;
}
@ -125,12 +122,9 @@ namespace Server.Spells.Spellweaving
if (m != Caster && m is PlayerMobile && Caster.CanBeBeneficial(m, false) &&
Math.Abs(spellWeaving - m.Skills.Spellweaving.Value) <= 20)
{
eable.Free();
return true;
}
}
eable.Free();
return false;
}
@ -150,8 +144,6 @@ namespace Server.Spells.Spellweaving
pool.Enqueue(m);
}
}
eable.Free();
return pool;
}

View file

@ -63,8 +63,6 @@ namespace Server.Spells.Spellweaving
new BuffInfo(BuffIcon.EssenceOfWind, 1075802, duration, m, $"{fcMalus}\t{ssiMalus}")
);
}
eable.Free();
}
FinishSequence();

View file

@ -72,8 +72,6 @@ namespace Server.Spells.Spellweaving
new BuffInfo(BuffIcon.Thunderstorm, 1075800, duration, m, GetCastRecoveryMalus(m))
);
}
eable.Free();
}
FinishSequence();

View file

@ -106,8 +106,6 @@ namespace Server.Spells.Third
item.OnMoveOver(m);
}
}
eable.Free();
}
FinishSequence();