Inline UID

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:53:09 +01:00
parent 2654775bf0
commit 5cd42c9ad6
803 changed files with 3613 additions and 3577 deletions

View File

@@ -122,7 +122,7 @@ namespace Content.Server.Construction.Components
RegenerateProgress();
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner.Uid, out var construction))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ConstructionComponent?>(Owner, out var construction))
{
// Attempt to set pathfinding to the machine node...
EntitySystem.Get<ConstructionSystem>().SetPathfindingTarget(OwnerUid, "machine", construction);
@@ -168,7 +168,7 @@ namespace Content.Server.Construction.Components
if (!HasBoard)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out appearance))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out appearance))
{
appearance.SetData(MachineFrameVisuals.State, 1);
}
@@ -187,10 +187,10 @@ namespace Content.Server.Construction.Components
var board = _boardContainer.ContainedEntities[0];
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<MachineBoardComponent?>(board.Uid, out var machineBoard))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<MachineBoardComponent?>(board, out var machineBoard))
return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out appearance))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out appearance))
{
appearance.SetData(MachineFrameVisuals.State, 2);
}
@@ -199,7 +199,7 @@ namespace Content.Server.Construction.Components
foreach (var part in _partContainer.ContainedEntities)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MachinePartComponent?>(part.Uid, out var machinePart))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MachinePartComponent?>(part, out var machinePart))
{
// Check this is part of the requirements...
if (!Requirements.ContainsKey(machinePart.PartType))
@@ -211,7 +211,7 @@ namespace Content.Server.Construction.Components
_progress[machinePart.PartType]++;
}
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<StackComponent?>(part.Uid, out var stack))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<StackComponent?>(part, out var stack))
{
var type = stack.StackTypeId;
// Check this is part of the requirements...
@@ -229,7 +229,7 @@ namespace Content.Server.Construction.Components
{
var registration = _componentFactory.GetRegistration(compName);
if (!IoCManager.Resolve<IEntityManager>().HasComponent(part.Uid, registration.Type))
if (!IoCManager.Resolve<IEntityManager>().HasComponent(part, registration.Type))
continue;
if (!_componentProgress.ContainsKey(compName))
@@ -254,7 +254,7 @@ namespace Content.Server.Construction.Components
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
if (!HasBoard && IoCManager.Resolve<IEntityManager>().TryGetComponent<MachineBoardComponent?>(eventArgs.Using.Uid, out var machineBoard))
if (!HasBoard && IoCManager.Resolve<IEntityManager>().TryGetComponent<MachineBoardComponent?>(eventArgs.Using, out var machineBoard))
{
if (eventArgs.Using.TryRemoveFromContainer())
{
@@ -264,12 +264,12 @@ namespace Content.Server.Construction.Components
// Setup requirements and progress...
ResetProgressAndRequirements(machineBoard);
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<AppearanceComponent?>(Owner.Uid, out var appearance))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<AppearanceComponent?>(Owner, out var appearance))
{
appearance.SetData(MachineFrameVisuals.State, 2);
}
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out ConstructionComponent? construction))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out ConstructionComponent? construction))
{
// So prying the components off works correctly.
EntitySystem.Get<ConstructionSystem>().ResetEdge(OwnerUid, construction);
@@ -280,7 +280,7 @@ namespace Content.Server.Construction.Components
}
else if (HasBoard)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MachinePartComponent?>(eventArgs.Using.Uid, out var machinePart))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<MachinePartComponent?>(eventArgs.Using, out var machinePart))
{
if (!Requirements.ContainsKey(machinePart.PartType))
return false;
@@ -293,7 +293,7 @@ namespace Content.Server.Construction.Components
}
}
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<StackComponent?>(eventArgs.Using.Uid, out var stack))
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<StackComponent?>(eventArgs.Using, out var stack))
{
var type = stack.StackTypeId;
if (!MaterialRequirements.ContainsKey(type))
@@ -314,7 +314,7 @@ namespace Content.Server.Construction.Components
return true;
}
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using.Uid, needed, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates, stack);
var splitStack = EntitySystem.Get<StackSystem>().Split(eventArgs.Using, needed, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates, stack);
if (splitStack == null)
return false;
@@ -333,7 +333,7 @@ namespace Content.Server.Construction.Components
var registration = _componentFactory.GetRegistration(compName);
if (!IoCManager.Resolve<IEntityManager>().HasComponent(eventArgs.Using.Uid, registration.Type))
if (!IoCManager.Resolve<IEntityManager>().HasComponent(eventArgs.Using, registration.Type))
continue;
if (!eventArgs.Using.TryRemoveFromContainer() || !_partContainer.Insert(eventArgs.Using)) continue;