Refactor pauses (#2215)
* Refactor pauses * The last of the physics Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -11,13 +11,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
foreach (var comp in ComponentManager.EntityQuery<BatteryDischargerComponent>())
|
foreach (var comp in ComponentManager.EntityQuery<BatteryDischargerComponent>(false))
|
||||||
{
|
{
|
||||||
if (comp.Owner.Paused)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
comp.Update(frameTime);
|
comp.Update(frameTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
foreach (var comp in ComponentManager.EntityQuery<BatteryStorageComponent>())
|
foreach (var comp in ComponentManager.EntityQuery<BatteryStorageComponent>(false))
|
||||||
{
|
{
|
||||||
if (comp.Owner.Paused)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
comp.Update(frameTime);
|
comp.Update(frameTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
foreach (var (moverComponent, physics) in EntityManager.ComponentManager.EntityQuery<IMoverComponent, IPhysicsComponent>(false))
|
foreach (var (moverComponent, collidableComponent) in EntityManager.ComponentManager.EntityQuery<IMoverComponent, IPhysicsComponent>(false))
|
||||||
{
|
{
|
||||||
var entity = moverComponent.Owner;
|
var entity = moverComponent.Owner;
|
||||||
UpdateKinematics(entity.Transform, moverComponent, physics);
|
UpdateKinematics(entity.Transform, moverComponent, collidableComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,9 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
var uniqueApcNets = new HashSet<IApcNet>(); //could be improved by maintaining set instead of getting collection every frame
|
var uniqueApcNets = new HashSet<IApcNet>(); //could be improved by maintaining set instead of getting collection every frame
|
||||||
foreach (var apc in ComponentManager.EntityQuery<ApcComponent>())
|
foreach (var apc in ComponentManager.EntityQuery<ApcComponent>(false))
|
||||||
{
|
{
|
||||||
if (apc.Owner.Paused)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
uniqueApcNets.Add(apc.Net);
|
uniqueApcNets.Add(apc.Net);
|
||||||
apc.Update();
|
apc.Update();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user