#1607 deprecate IEntityQuery (#4204)

* #1607 partial progress

* #1607 partial progress

* #1607 almost done

* #1607 PR suggestions

* #1607 PR suggestions

* #1607 PR suggestions

* #1607 PR tweak

* #1607 PR tweak

* #1607 removed unused namespaces

* #1607 PR tweak

* Fix jank

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Galactic Chimp
2021-06-27 05:40:03 +02:00
committed by GitHub
parent 71d939bed5
commit 769daedaa9
10 changed files with 45 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Server.Administration;
using Content.Server.ParticleAccelerator.Components;
using Content.Server.Singularity.Components;
@@ -26,20 +26,19 @@ namespace Content.Server.Singularity
}
var entityManager = IoCManager.Resolve<IEntityManager>();
foreach (var ent in entityManager.GetEntities(new TypeEntityQuery(typeof(EmitterComponent))))
foreach (var comp in entityManager.ComponentManager.EntityQuery<EmitterComponent>())
{
ent.GetComponent<EmitterComponent>().SwitchOn();
comp.SwitchOn();
}
foreach (var ent in entityManager.GetEntities(new TypeEntityQuery(typeof(RadiationCollectorComponent))))
foreach (var comp in entityManager.ComponentManager.EntityQuery<RadiationCollectorComponent>())
{
ent.GetComponent<RadiationCollectorComponent>().Collecting = true;
comp.Collecting = true;
}
foreach (var ent in entityManager.GetEntities(new TypeEntityQuery(typeof(ParticleAcceleratorControlBoxComponent))))
foreach (var comp in entityManager.ComponentManager.EntityQuery<ParticleAcceleratorControlBoxComponent>())
{
var pacb = ent.GetComponent<ParticleAcceleratorControlBoxComponent>();
pacb.RescanParts();
pacb.SetStrength(ParticleAcceleratorPowerState.Level0);
pacb.SwitchOn();
comp.RescanParts();
comp.SetStrength(ParticleAcceleratorPowerState.Level0);
comp.SwitchOn();
}
shell.WriteLine("Done!");
}