Pausing content (#3061)

* Change EntityQuery to not retrieve paused by default

* GetAllComponents

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-02-04 00:20:48 +11:00
committed by GitHub
parent c40ac26ced
commit 684ec60be6
65 changed files with 69 additions and 71 deletions

View File

@@ -79,7 +79,7 @@ namespace Content.Benchmarks
{ {
var count = 0; var count = 0;
foreach (var _ in _componentManager.EntityQuery<DummyComponent>()) foreach (var _ in _componentManager.EntityQuery<DummyComponent>(true))
{ {
count += 1; count += 1;
} }

View File

@@ -52,7 +52,7 @@ namespace Content.Client.Commands
.EnableAll = true; .EnableAll = true;
var components = IoCManager.Resolve<IEntityManager>().ComponentManager var components = IoCManager.Resolve<IEntityManager>().ComponentManager
.EntityQuery<SubFloorHideComponent>(); .EntityQuery<SubFloorHideComponent>(true);
foreach (var component in components) foreach (var component in components)
{ {

View File

@@ -17,7 +17,7 @@ namespace Content.Client.Commands
public void Execute(IConsoleShell shell, string argStr, string[] args) public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var componentManager = IoCManager.Resolve<IComponentManager>(); var componentManager = IoCManager.Resolve<IComponentManager>();
var mechanisms = componentManager.EntityQuery<IMechanism>(); var mechanisms = componentManager.EntityQuery<IMechanism>(true);
foreach (var mechanism in mechanisms) foreach (var mechanism in mechanisms)
{ {

View File

@@ -19,7 +19,7 @@ namespace Content.Client.Commands
public void Execute(IConsoleShell shell, string argStr, string[] args) public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
var componentManager = IoCManager.Resolve<IComponentManager>(); var componentManager = IoCManager.Resolve<IComponentManager>();
var mechanisms = componentManager.EntityQuery<IMechanism>(); var mechanisms = componentManager.EntityQuery<IMechanism>(true);
foreach (var mechanism in mechanisms) foreach (var mechanism in mechanisms)
{ {

View File

@@ -46,7 +46,7 @@ namespace Content.Client.GameObjects.Components.Observer
private void SetGhostVisibility(bool visibility) private void SetGhostVisibility(bool visibility)
{ {
foreach (var ghost in _componentManager.GetAllComponents(typeof(GhostComponent))) foreach (var ghost in _componentManager.GetAllComponents(typeof(GhostComponent), true))
{ {
if (ghost.Owner.TryGetComponent(out SpriteComponent? component)) if (ghost.Owner.TryGetComponent(out SpriteComponent? component))
{ {

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
base.FrameUpdate(frameTime); base.FrameUpdate(frameTime);
foreach (var recoil in EntityManager.ComponentManager.EntityQuery<CameraRecoilComponent>()) foreach (var recoil in EntityManager.ComponentManager.EntityQuery<CameraRecoilComponent>(true))
{ {
recoil.FrameUpdate(frameTime); recoil.FrameUpdate(frameTime);
} }

View File

@@ -61,7 +61,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
if (_attachedEntity == null || _attachedEntity.Deleted) if (_attachedEntity == null || _attachedEntity.Deleted)
return; return;
foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>()) foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>(true))
{ {
if (!_knownComponents.Contains(comp)) if (!_knownComponents.Contains(comp))
{ {

View File

@@ -44,7 +44,7 @@ namespace Content.Client.GameObjects.EntitySystems
return; return;
} }
foreach (var instrumentComponent in EntityManager.ComponentManager.EntityQuery<InstrumentComponent>()) foreach (var instrumentComponent in EntityManager.ComponentManager.EntityQuery<InstrumentComponent>(true))
{ {
instrumentComponent.Update(frameTime); instrumentComponent.Update(frameTime);
} }

View File

@@ -19,7 +19,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void UpdateMarkers() private void UpdateMarkers()
{ {
foreach (var markerComponent in EntityManager.ComponentManager.EntityQuery<MarkerComponent>()) foreach (var markerComponent in EntityManager.ComponentManager.EntityQuery<MarkerComponent>(true))
{ {
markerComponent.UpdateVisibility(); markerComponent.UpdateVisibility();
} }

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
base.FrameUpdate(frameTime); base.FrameUpdate(frameTime);
foreach (var meleeLungeComponent in EntityManager.ComponentManager.EntityQuery<MeleeLungeComponent>()) foreach (var meleeLungeComponent in EntityManager.ComponentManager.EntityQuery<MeleeLungeComponent>(true))
{ {
meleeLungeComponent.Update(frameTime); meleeLungeComponent.Update(frameTime);
} }

View File

@@ -34,7 +34,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
base.FrameUpdate(frameTime); base.FrameUpdate(frameTime);
foreach (var arcAnimationComponent in EntityManager.ComponentManager.EntityQuery<MeleeWeaponArcAnimationComponent>()) foreach (var arcAnimationComponent in EntityManager.ComponentManager.EntityQuery<MeleeWeaponArcAnimationComponent>(true))
{ {
arcAnimationComponent.Update(frameTime); arcAnimationComponent.Update(frameTime);
} }

View File

@@ -35,7 +35,7 @@ namespace Content.Client.GameObjects.EntitySystems
private void UpdateAll() private void UpdateAll()
{ {
foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>()) foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>(true))
{ {
if (!_mapManager.TryGetGrid(comp.Owner.Transform.GridID, out var grid)) return; if (!_mapManager.TryGetGrid(comp.Owner.Transform.GridID, out var grid)) return;

View File

@@ -124,7 +124,7 @@ namespace Content.Client.StationEvents
_lastTick = _gameTiming.CurTime; _lastTick = _gameTiming.CurTime;
var radiationPulses = _componentManager var radiationPulses = _componentManager
.EntityQuery<RadiationPulseComponent>() .EntityQuery<RadiationPulseComponent>(true)
.ToList(); .ToList();
var screenHandle = (DrawingHandleScreen) handle; var screenHandle = (DrawingHandleScreen) handle;

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Administration.Commands
} }
var componentType = registration.Type; var componentType = registration.Type;
var components = entityManager.ComponentManager.GetAllComponents(componentType); var components = entityManager.ComponentManager.GetAllComponents(componentType, true);
var i = 0; var i = 0;

View File

@@ -43,7 +43,7 @@ namespace Content.Server.Administration.Commands
if (location == "?") if (location == "?")
{ {
var locations = string.Join(", ", var locations = string.Join(", ",
comp.EntityQuery<WarpPointComponent>() comp.EntityQuery<WarpPointComponent>(true)
.Select(p => p.Location) .Select(p => p.Location)
.Where(p => p != null) .Where(p => p != null)
.OrderBy(p => p) .OrderBy(p => p)
@@ -64,7 +64,7 @@ namespace Content.Server.Administration.Commands
var currentGrid = player.AttachedEntity.Transform.GridID; var currentGrid = player.AttachedEntity.Transform.GridID;
var entityManager = IoCManager.Resolve<IEntityManager>(); var entityManager = IoCManager.Resolve<IEntityManager>();
var found = comp.EntityQuery<WarpPointComponent>() var found = comp.EntityQuery<WarpPointComponent>(true)
.Where(p => p.Location == location) .Where(p => p.Location == location)
.Select(p => p.Owner.Transform.Coordinates) .Select(p => p.Owner.Transform.Coordinates)
.OrderBy(p => p, Comparer<EntityCoordinates>.Create((a, b) => .OrderBy(p => p, Comparer<EntityCoordinates>.Create((a, b) =>

View File

@@ -144,7 +144,7 @@ namespace Content.Server.GameObjects.Components.Observer
private List<WarpPointComponent> FindWaypoints() private List<WarpPointComponent> FindWaypoints()
{ {
var comp = IoCManager.Resolve<IComponentManager>(); var comp = IoCManager.Resolve<IComponentManager>();
return comp.EntityQuery<WarpPointComponent>().ToList(); return comp.EntityQuery<WarpPointComponent>(true).ToList();
} }
public void Examine(FormattedMessage message, bool inDetailsRange) public void Examine(FormattedMessage message, bool inDetailsRange)

View File

@@ -48,7 +48,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI
yield break; yield break;
} }
foreach (var component in ComponentManager.EntityQuery<AiFactionTagComponent>()) foreach (var component in ComponentManager.EntityQuery<AiFactionTagComponent>(true))
{ {
if ((component.Factions & hostile) == 0) if ((component.Factions & hostile) == 0)
continue; continue;

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.EntitySystems
_accumulatedFrameTime += frameTime; _accumulatedFrameTime += frameTime;
if (_accumulatedFrameTime >= 10) if (_accumulatedFrameTime >= 10)
{ {
foreach (var comp in ComponentManager.EntityQuery<AMEControllerComponent>()) foreach (var comp in ComponentManager.EntityQuery<AMEControllerComponent>(true))
{ {
comp.OnUpdate(frameTime); comp.OnUpdate(frameTime);
} }

View File

@@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_lastUpdate < UpdateDelay) return; if (_lastUpdate < UpdateDelay) return;
// creadth: everything exposable by atmos should be updated as well // creadth: everything exposable by atmos should be updated as well
foreach (var atmosExposedComponent in EntityManager.ComponentManager.EntityQuery<AtmosExposedComponent>()) foreach (var atmosExposedComponent in EntityManager.ComponentManager.EntityQuery<AtmosExposedComponent>(true))
{ {
var tile = atmosExposedComponent.Owner.Transform.Coordinates.GetTileAtmosphere(EntityManager); var tile = atmosExposedComponent.Owner.Transform.Coordinates.GetTileAtmosphere(EntityManager);
if (tile == null) continue; if (tile == null) continue;

View File

@@ -143,7 +143,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var (mapGridComponent, gridAtmosphereComponent) in EntityManager.ComponentManager.EntityQuery<IMapGridComponent, IGridAtmosphereComponent>()) foreach (var (mapGridComponent, gridAtmosphereComponent) in EntityManager.ComponentManager.EntityQuery<IMapGridComponent, IGridAtmosphereComponent>(true))
{ {
if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex)) continue; if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex)) continue;

View File

@@ -63,7 +63,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<BlockGameArcadeComponent>()) foreach (var comp in ComponentManager.EntityQuery<BlockGameArcadeComponent>(true))
{ {
comp.DoGameTick(frameTime); comp.DoGameTick(frameTime);
} }

View File

@@ -180,7 +180,7 @@ namespace Content.Server.GameObjects.EntitySystems
private void SyncComponentsWithId(int id) private void SyncComponentsWithId(int id)
{ {
foreach (var comp in ComponentManager.EntityQuery<CargoOrderDatabaseComponent>()) foreach (var comp in ComponentManager.EntityQuery<CargoOrderDatabaseComponent>(true))
{ {
if (!comp.ConnectedToDatabase || comp.Database.Id != id) if (!comp.ConnectedToDatabase || comp.Database.Id != id)
continue; continue;

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<ClimbingComponent>()) foreach (var comp in ComponentManager.EntityQuery<ClimbingComponent>(true))
{ {
comp.Update(); comp.Update();
} }

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<CloningPodComponent>()) foreach (var comp in ComponentManager.EntityQuery<CloningPodComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }
@@ -23,7 +23,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
if (!Minds.ContainsValue(mind)) if (!Minds.ContainsValue(mind))
{ {
Minds.Add(Minds.Count(), mind); Minds.Add(Minds.Count, mind);
} }
} }

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<ConveyorComponent>()) foreach (var comp in ComponentManager.EntityQuery<ConveyorComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<DisposalHolderComponent>()) foreach (var comp in ComponentManager.EntityQuery<DisposalHolderComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }

View File

@@ -17,10 +17,8 @@ namespace Content.Server.GameObjects.EntitySystems.DoAfter
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>()) foreach (var comp in ComponentManager.EntityQuery<DoAfterComponent>(true))
{ {
if (comp.Owner.Paused) continue;
var cancelled = new List<DoAfter>(0); var cancelled = new List<DoAfter>(0);
var finished = new List<DoAfter>(0); var finished = new List<DoAfter>(0);

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var light in ComponentManager.EntityQuery<ExpendableLightComponent>()) foreach (var light in ComponentManager.EntityQuery<ExpendableLightComponent>(true))
{ {
light.Update(frameTime); light.Update(frameTime);
} }

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var analyzer in ComponentManager.EntityQuery<GasAnalyzerComponent>()) foreach (var analyzer in ComponentManager.EntityQuery<GasAnalyzerComponent>(true))
{ {
analyzer.Update(frameTime); analyzer.Update(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var component in ComponentManager.EntityQuery<GasCanisterComponent>()) foreach (var component in ComponentManager.EntityQuery<GasCanisterComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -23,7 +23,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_timer < Interval) return; if (_timer < Interval) return;
_timer = 0f; _timer = 0f;
foreach (var gasTank in EntityManager.ComponentManager.EntityQuery<GasTankComponent>()) foreach (var gasTank in EntityManager.ComponentManager.EntityQuery<GasTankComponent>(true))
{ {
gasTank.Update(); gasTank.Update();
} }

View File

@@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
_internalTimer += frameTime; _internalTimer += frameTime;
var gridsWithGravity = new List<GridId>(); var gridsWithGravity = new List<GridId>();
foreach (var generator in ComponentManager.EntityQuery<GravityGeneratorComponent>()) foreach (var generator in ComponentManager.EntityQuery<GravityGeneratorComponent>(true))
{ {
if (generator.NeedsUpdate) if (generator.NeedsUpdate)
{ {

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_accumulatedFrameTime > 1) if (_accumulatedFrameTime > 1)
{ {
foreach (var comp in ComponentManager.EntityQuery<HungerComponent>()) foreach (var comp in ComponentManager.EntityQuery<HungerComponent>(true))
{ {
comp.OnUpdate(_accumulatedFrameTime); comp.OnUpdate(_accumulatedFrameTime);
} }

View File

@@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var component in ComponentManager.EntityQuery<InstrumentComponent>()) foreach (var component in ComponentManager.EntityQuery<InstrumentComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<LatheComponent>()) foreach (var comp in ComponentManager.EntityQuery<LatheComponent>(true))
{ {
if (comp.Producing == false && comp.Queue.Count > 0) if (comp.Producing == false && comp.Queue.Count > 0)
{ {

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public void PingListeners(IEntity source, string message) public void PingListeners(IEntity source, string message)
{ {
foreach (var listener in ComponentManager.EntityQuery<IListen>()) foreach (var listener in ComponentManager.EntityQuery<IListen>(true))
{ {
// TODO: Map Position distance // TODO: Map Position distance
if (listener.CanListen(message, source)) if (listener.CanListen(message, source))

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<MedicalScannerComponent>()) foreach (var comp in ComponentManager.EntityQuery<MedicalScannerComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var metabolism in ComponentManager.EntityQuery<MetabolismComponent>()) foreach (var metabolism in ComponentManager.EntityQuery<MetabolismComponent>(true))
{ {
metabolism.Update(frameTime); metabolism.Update(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var comp in ComponentManager.EntityQuery<MicrowaveComponent>()) foreach (var comp in ComponentManager.EntityQuery<MicrowaveComponent>(true))
{ {
comp.OnUpdate(); comp.OnUpdate();
} }

View File

@@ -16,7 +16,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_accumulatedFrameTime >= 10) if (_accumulatedFrameTime >= 10)
{ {
foreach (var morgue in ComponentManager.EntityQuery<MorgueEntityStorageComponent>()) foreach (var morgue in ComponentManager.EntityQuery<MorgueEntityStorageComponent>(true))
{ {
morgue.Update(); morgue.Update();
} }

View File

@@ -70,7 +70,7 @@ namespace Content.Server.GameObjects.EntitySystems
_timer = 0f; _timer = 0f;
foreach (var plantHolder in _componentManager.EntityQuery<PlantHolderComponent>()) foreach (var plantHolder in _componentManager.EntityQuery<PlantHolderComponent>(true))
{ {
plantHolder.Update(); plantHolder.Update();
} }

View File

@@ -199,7 +199,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var component in ComponentManager.EntityQuery<PointingArrowComponent>()) foreach (var component in ComponentManager.EntityQuery<PointingArrowComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<BaseCharger>()) foreach (var comp in ComponentManager.EntityQuery<BaseCharger>(true))
{ {
comp.OnUpdate(frameTime); comp.OnUpdate(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<BatteryComponent>()) foreach (var comp in ComponentManager.EntityQuery<BatteryComponent>(true))
{ {
comp.OnUpdate(frameTime); comp.OnUpdate(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<SmesComponent>()) foreach (var comp in ComponentManager.EntityQuery<SmesComponent>(true))
{ {
comp.OnUpdate(); comp.OnUpdate();
} }

View File

@@ -22,7 +22,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_updateTimer >= 1) if (_updateTimer >= 1)
{ {
_updateTimer -= 1; _updateTimer -= 1;
foreach (var component in ComponentManager.EntityQuery<SolarControlConsoleComponent>()) foreach (var component in ComponentManager.EntityQuery<SolarControlConsoleComponent>(true))
{ {
component.UpdateUIState(); component.UpdateUIState();
} }

View File

@@ -87,7 +87,7 @@ namespace Content.Server.GameObjects.EntitySystems
TotalPanelPower = 0; TotalPanelPower = 0;
foreach (var panel in ComponentManager.EntityQuery<SolarPanelComponent>()) foreach (var panel in ComponentManager.EntityQuery<SolarPanelComponent>(true))
{ {
// There's supposed to be rotational logic here, but that implies putting it somewhere. // There's supposed to be rotational logic here, but that implies putting it somewhere.
panel.Owner.Transform.WorldRotation = TargetPanelRotation; panel.Owner.Transform.WorldRotation = TargetPanelRotation;

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var component in ComponentManager.EntityQuery<ProjectileComponent>()) foreach (var component in ComponentManager.EntityQuery<ProjectileComponent>(true))
{ {
component.TimeLeft -= frameTime; component.TimeLeft -= frameTime;

View File

@@ -28,7 +28,7 @@ namespace Content.Server.GameObjects.EntitySystems
private void HandleTileChanged(object sender, TileChangedEventArgs eventArgs) private void HandleTileChanged(object sender, TileChangedEventArgs eventArgs)
{ {
// If this gets hammered you could probably queue up all the tile changes every tick but I doubt that would ever happen. // If this gets hammered you could probably queue up all the tile changes every tick but I doubt that would ever happen.
foreach (var (puddle, snapGrid) in ComponentManager.EntityQuery<PuddleComponent, SnapGridComponent>()) foreach (var (puddle, snapGrid) in ComponentManager.EntityQuery<PuddleComponent, SnapGridComponent>(true))
{ {
// If the tile becomes space then delete it (potentially change by design) // If the tile becomes space then delete it (potentially change by design)
if (eventArgs.NewTile.GridIndex == puddle.Owner.Transform.GridID && if (eventArgs.NewTile.GridIndex == puddle.Owner.Transform.GridID &&

View File

@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.EntitySystems
_messages.Add(message); _messages.Add(message);
foreach (var radio in ComponentManager.EntityQuery<IRadio>()) foreach (var radio in ComponentManager.EntityQuery<IRadio>(true))
{ {
if (radio.Channels.Contains(channel)) if (radio.Channels.Contains(channel))
{ {

View File

@@ -10,7 +10,7 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var comp in ComponentManager.EntityQuery<ReagentGrinderComponent>()) foreach (var comp in ComponentManager.EntityQuery<ReagentGrinderComponent>(true))
{ {
comp.OnUpdate(); comp.OnUpdate();
} }

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var component in ComponentManager.EntityQuery<RecyclerComponent>()) foreach (var component in ComponentManager.EntityQuery<RecyclerComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var component in ComponentManager.EntityQuery<RoguePointingArrowComponent>()) foreach (var component in ComponentManager.EntityQuery<RoguePointingArrowComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects.EntitySystems
var shouldUpdate = curTimeSingulo >= 1f; var shouldUpdate = curTimeSingulo >= 1f;
var shouldPull = curTimePull >= 0.2f; var shouldPull = curTimePull >= 0.2f;
if (!shouldUpdate && !shouldPull) return; if (!shouldUpdate && !shouldPull) return;
var singulos = ComponentManager.EntityQuery<SingularityComponent>(); var singulos = ComponentManager.EntityQuery<SingularityComponent>(true);
if (curTimeSingulo >= 1f) if (curTimeSingulo >= 1f)
{ {

View File

@@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var comp in ComponentManager.EntityQuery<RadiationPulseComponent>()) foreach (var comp in ComponentManager.EntityQuery<RadiationPulseComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
var ent = comp.Owner; var ent = comp.Owner;

View File

@@ -23,7 +23,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <inheritdoc /> /// <inheritdoc />
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var component in ComponentManager.EntityQuery<ServerStorageComponent>()) foreach (var component in ComponentManager.EntityQuery<ServerStorageComponent>(true))
{ {
CheckSubscribedEntities(component); CheckSubscribedEntities(component);
} }

View File

@@ -13,7 +13,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var stressTest in ComponentManager.EntityQuery<StressTestMovementComponent>()) foreach (var stressTest in ComponentManager.EntityQuery<StressTestMovementComponent>(true))
{ {
var transform = stressTest.Owner.Transform; var transform = stressTest.Owner.Transform;

View File

@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var component in ComponentManager.EntityQuery<StunnableComponent>()) foreach (var component in ComponentManager.EntityQuery<StunnableComponent>(true))
{ {
component.Update(frameTime); component.Update(frameTime);
} }

View File

@@ -15,7 +15,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (_accumulatedFrameTime > 1) if (_accumulatedFrameTime > 1)
{ {
foreach (var component in ComponentManager.EntityQuery<ThirstComponent>()) foreach (var component in ComponentManager.EntityQuery<ThirstComponent>(true))
{ {
component.OnUpdate(_accumulatedFrameTime); component.OnUpdate(_accumulatedFrameTime);
} }

View File

@@ -9,7 +9,7 @@ namespace Content.Server.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var vaporComp in ComponentManager.EntityQuery<VaporComponent>()) foreach (var vaporComp in ComponentManager.EntityQuery<VaporComponent>(true))
{ {
vaporComp.Update(frameTime); vaporComp.Update(frameTime);
} }

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Objectives.Conditions
public override IObjectiveCondition GetAssigned(Mind mind) public override IObjectiveCondition GetAssigned(Mind mind)
{ {
var entityMgr = IoCManager.Resolve<IEntityManager>(); var entityMgr = IoCManager.Resolve<IEntityManager>();
var allHumans = entityMgr.ComponentManager.EntityQuery<MindComponent>().Where(mc => var allHumans = entityMgr.ComponentManager.EntityQuery<MindComponent>(true).Where(mc =>
{ {
var entity = mc.Mind?.OwnedEntity; var entity = mc.Mind?.OwnedEntity;
return (entity?.GetComponentOrNull<IMobStateComponent>()?.IsAlive() ?? false) && mc.Mind != mind; return (entity?.GetComponentOrNull<IMobStateComponent>()?.IsAlive() ?? false) && mc.Mind != mind;

View File

@@ -43,7 +43,7 @@ namespace Content.Server.StationEvents
{ {
var componentManager = IoCManager.Resolve<IComponentManager>(); var componentManager = IoCManager.Resolve<IComponentManager>();
foreach (var component in componentManager.EntityQuery<PowerReceiverComponent>()) foreach (var component in componentManager.EntityQuery<PowerReceiverComponent>(true))
{ {
component.PowerDisabled = true; component.PowerDisabled = true;
_powered.Add(component.Owner); _powered.Add(component.Owner);

View File

@@ -12,7 +12,7 @@ namespace Content.Shared.GameObjects.EntitySystems
{ {
base.Update(frameTime); base.Update(frameTime);
foreach (var mechanism in ComponentManager.EntityQuery<IMechanism>()) foreach (var mechanism in ComponentManager.EntityQuery<IMechanism>(true))
{ {
mechanism.Update(frameTime); mechanism.Update(frameTime);
} }

View File

@@ -9,12 +9,12 @@ namespace Content.Shared.GameObjects.EntitySystems
{ {
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var comp in ComponentManager.EntityQuery<SharedDisposalUnitComponent>()) foreach (var comp in ComponentManager.EntityQuery<SharedDisposalUnitComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }
foreach (var comp in ComponentManager.EntityQuery<SharedDisposalMailingUnitComponent>()) foreach (var comp in ComponentManager.EntityQuery<SharedDisposalMailingUnitComponent>(true))
{ {
comp.Update(frameTime); comp.Update(frameTime);
} }

View File

@@ -10,7 +10,7 @@ namespace Content.Shared.GameObjects.EntitySystems
/// <inheritdoc /> /// <inheritdoc />
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var slipperyComp in ComponentManager.EntityQuery<SharedSlipperyComponent>()) foreach (var slipperyComp in ComponentManager.EntityQuery<SharedSlipperyComponent>(true))
{ {
slipperyComp.Update(); slipperyComp.Update();
} }