Fix build.

I HATE STATIC I HATE STATIC I HATE STATIC
This commit is contained in:
Vera Aguilera Puerto
2021-12-08 13:07:24 +01:00
parent c8b65be747
commit 0a71b62305
7 changed files with 32 additions and 23 deletions

View File

@@ -24,7 +24,7 @@ namespace Content.Server.ParticleAccelerator.EntitySystems
component.OnAnchorChanged();
}
private static void RotateEvent(ref RotateEvent ev)
private void RotateEvent(ref RotateEvent ev)
{
if (EntityManager.TryGetComponent(ev.Sender, out ParticleAcceleratorPartComponent? part))
{

View File

@@ -172,7 +172,7 @@ namespace Content.Server.Power.EntitySystems
RaiseLocalEvent(provider.Owner, new ReceiverConnectedEvent(receiver), broadcast: false);
}
private static bool TryFindAvailableProvider(EntityUid owner, float range, [NotNullWhen(true)] out ExtensionCableProviderComponent? foundProvider)
private bool TryFindAvailableProvider(EntityUid owner, float range, [NotNullWhen(true)] out ExtensionCableProviderComponent? foundProvider)
{
var nearbyEntities = IoCManager.Resolve<IEntityLookup>()
.GetEntitiesInRange(owner, range);

View File

@@ -317,7 +317,7 @@ namespace Content.Server.Power.EntitySystems
_powerState.Networks.Allocate(out network.Id) = network;
}
private static void DoReconnectApcNet(ApcNet net)
private void DoReconnectApcNet(ApcNet net)
{
var netNode = net.NetworkNode;
@@ -349,7 +349,7 @@ namespace Content.Server.Power.EntitySystems
}
}
private static void DoReconnectPowerNet(PowerNet net)
private void DoReconnectPowerNet(PowerNet net)
{
var netNode = net.NetworkNode;

View File

@@ -74,7 +74,7 @@ namespace Content.Server.Rotatable
/// <summary>
/// Replace a flippable entity with it's flipped / mirror-symmetric entity.
/// </summary>
public static void TryFlip(FlippableComponent component, EntityUid user)
public void TryFlip(FlippableComponent component, EntityUid user)
{
if (EntityManager.TryGetComponent(component.Owner, out IPhysBody? physics) &&
physics.BodyType == BodyType.Static)

View File

@@ -114,7 +114,7 @@ namespace Content.Server.Storage.EntitySystems
args.Verbs.Add(verb);
}
private static void HandleEntityRemovedFromContainer(EntRemovedFromContainerMessage message)
private void HandleEntityRemovedFromContainer(EntRemovedFromContainerMessage message)
{
var oldParentEntity = message.Container.Owner;
@@ -124,7 +124,7 @@ namespace Content.Server.Storage.EntitySystems
}
}
private static void HandleEntityInsertedIntoContainer(EntInsertedIntoContainerMessage message)
private void HandleEntityInsertedIntoContainer(EntInsertedIntoContainerMessage message)
{
var oldParentEntity = message.Container.Owner;

View File

@@ -109,6 +109,7 @@ namespace Content.Shared.Examine
other.MapId == MapId.Nullspace) return false;
var occluderSystem = Get<OccluderSystem>();
var entMan = IoCManager.Resolve<IEntityManager>();
if (!origin.InRange(other, range)) return false;
var dir = other.Position - origin.Position;
@@ -128,12 +129,12 @@ namespace Content.Shared.Examine
foreach (var result in rayResults)
{
if (!EntityManager.TryGetComponent(result.HitEntity, out OccluderComponent? o))
if (!entMan.TryGetComponent(result.HitEntity, out OccluderComponent? o))
{
continue;
}
var bBox = o.BoundingBox.Translated(EntityManager.GetComponent<TransformComponent>(o.Owner).WorldPosition);
var bBox = o.BoundingBox.Translated(entMan.GetComponent<TransformComponent>(o.Owner).WorldPosition);
if (bBox.Contains(origin.Position) || bBox.Contains(other.Position))
{
@@ -148,54 +149,60 @@ namespace Content.Shared.Examine
public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = EntityManager.GetComponent<TransformComponent>(other).MapPosition;
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = entMan.GetComponent<TransformComponent>(other).MapPosition;
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(EntityUid origin, IComponent other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = EntityManager.GetComponent<TransformComponent>(other.Owner).MapPosition;
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = entMan.GetComponent<TransformComponent>(other.Owner).MapPosition;
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = other.ToMap(EntityManager);
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
var otherPos = other.ToMap(entMan);
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(origin).MapPosition;
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
return InRangeUnOccluded(originPos, other, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(ITargetedInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(args.User).MapPosition;
var otherPos = EntityManager.GetComponent<TransformComponent>(args.Target).MapPosition;
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(args.User).MapPosition;
var otherPos = entMan.GetComponent<TransformComponent>(args.Target).MapPosition;
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(DragDropEvent args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var originPos = EntityManager.GetComponent<TransformComponent>(args.User).MapPosition;
var otherPos = args.DropLocation.ToMap(EntityManager);
var entMan = IoCManager.Resolve<IEntityManager>();
var originPos = entMan.GetComponent<TransformComponent>(args.User).MapPosition;
var otherPos = args.DropLocation.ToMap(entMan);
return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
}
public static bool InRangeUnOccluded(AfterInteractEventArgs args, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
{
var entityManager = EntityManager;
var entityManager = IoCManager.Resolve<IEntityManager>();;
var originPos = entityManager.GetComponent<TransformComponent>(args.User).MapPosition;
var target = args.Target;
var otherPos = (target != null ? entityManager.GetComponent<TransformComponent>(target.Value).MapPosition : args.ClickLocation.ToMap(entityManager));

View File

@@ -82,10 +82,12 @@ namespace Content.Shared.Movement.EntitySystems
var ent = session?.AttachedEntity;
if (ent == null || !EntityManager.EntityExists(ent.Value))
var entMan = IoCManager.Resolve<IEntityManager>();
if (ent == null || !entMan.EntityExists(ent.Value))
return false;
if (!EntityManager.TryGetComponent(ent.Value, out T? comp))
if (!entMan.TryGetComponent(ent.Value, out T? comp))
return false;
component = comp;