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

@@ -17,7 +17,7 @@ namespace Content.Server.Disposal.Tube.Components
protected override Direction[] ConnectableDirections()
{
var direction = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation;
var direction = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation;
var side = new Angle(MathHelper.DegreesToRadians(direction.Degrees + _sideDegrees));
return new[] {direction.GetDir(), side.GetDir()};

View File

@@ -21,8 +21,8 @@ namespace Content.Server.Disposal.Tube.Components
public bool TryInsert(DisposalUnitComponent from)
{
var holder = IoCManager.Resolve<IEntityManager>().SpawnEntity(HolderPrototypeId, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).MapPosition);
var holderComponent = IoCManager.Resolve<IEntityManager>().GetComponent<DisposalHolderComponent>(holder.Uid);
var holder = IoCManager.Resolve<IEntityManager>().SpawnEntity(HolderPrototypeId, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).MapPosition);
var holderComponent = IoCManager.Resolve<IEntityManager>().GetComponent<DisposalHolderComponent>(holder);
foreach (var entity in from.ContainedEntities.ToArray())
{
@@ -37,7 +37,7 @@ namespace Content.Server.Disposal.Tube.Components
protected override Direction[] ConnectableDirections()
{
return new[] {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation.GetDir()};
return new[] {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation.GetDir()};
}
/// <summary>

View File

@@ -27,14 +27,14 @@ namespace Content.Server.Disposal.Tube.Components
protected override Direction[] ConnectableDirections()
{
var direction = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation;
var direction = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation;
return _degrees.Select(degree => new Angle(degree.Theta + direction.Theta).GetDir()).ToArray();
}
public override Direction NextDirection(DisposalHolderComponent holder)
{
var next = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation.GetDir();
var next = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation.GetDir();
var directions = ConnectableDirections().Skip(1).ToArray();
if (holder.PreviousDirectionFrom == Direction.Invalid ||

View File

@@ -36,7 +36,7 @@ namespace Content.Server.Disposal.Tube.Components
[ViewVariables]
public bool Anchored =>
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out IPhysBody? physics) ||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out IPhysBody? physics) ||
physics.BodyType == BodyType.Static;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(DisposalRouterUiKey.Key);
@@ -52,7 +52,7 @@ namespace Content.Server.Disposal.Tube.Components
return directions[1];
}
return IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation.GetDir();
return IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation.GetDir();
}
protected override void Initialize()
@@ -160,12 +160,12 @@ namespace Content.Server.Disposal.Tube.Components
/// <param name="args">Data relevant to the event such as the actor which triggered it.</param>
void IActivate.Activate(ActivateEventArgs args)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
{
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out HandsComponent? hands))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out HandsComponent? hands))
{
Owner.PopupMessage(args.User, Loc.GetString("disposal-router-window-tag-input-activate-no-hands"));
return;

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Disposal.Tube.Components
[ViewVariables]
public bool Anchored =>
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out PhysicsComponent? physics) ||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out PhysicsComponent? physics) ||
physics.BodyType == BodyType.Static;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(DisposalTaggerUiKey.Key);
@@ -126,12 +126,12 @@ namespace Content.Server.Disposal.Tube.Components
/// <param name="args">Data relevant to the event such as the actor which triggered it.</param>
void IActivate.Activate(ActivateEventArgs args)
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out ActorComponent? actor))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
{
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User.Uid, out HandsComponent? hands))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out HandsComponent? hands))
{
Owner.PopupMessage(args.User, Loc.GetString("disposal-tagger-window-activate-no-hands"));
return;

View File

@@ -15,7 +15,7 @@ namespace Content.Server.Disposal.Tube.Components
protected override Direction[] ConnectableDirections()
{
var rotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).LocalRotation;
var rotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).LocalRotation;
var opposite = new Angle(rotation.Theta + Math.PI);
return new[] {rotation.GetDir(), opposite.GetDir()};

View File

@@ -38,7 +38,7 @@ namespace Content.Server.Disposal.Tube.Components
[ViewVariables]
private bool Anchored =>
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out PhysicsComponent? physics) ||
!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out PhysicsComponent? physics) ||
physics.BodyType == BodyType.Static;
/// <summary>
@@ -91,7 +91,7 @@ namespace Content.Server.Disposal.Tube.Components
foreach (var entity in Contents.ContainedEntities.ToArray())
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out DisposalHolderComponent? holder))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out DisposalHolderComponent? holder))
{
continue;
}
@@ -109,7 +109,7 @@ namespace Content.Server.Disposal.Tube.Components
private void UpdateVisualState()
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out AppearanceComponent? appearance))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AppearanceComponent? appearance))
{
return;
}
@@ -125,7 +125,7 @@ namespace Content.Server.Disposal.Tube.Components
public void AnchoredChanged()
{
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out PhysicsComponent? physics))
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out PhysicsComponent? physics))
{
return;
}