Replace all ITransformComponent by TransformComponent

This commit is contained in:
Vera Aguilera Puerto
2021-11-08 12:37:32 +01:00
parent 789ae63301
commit e6e15b3728
36 changed files with 53 additions and 53 deletions

View File

@@ -48,7 +48,7 @@ namespace Content.Server.Construction.Completions
container.Remove(board);
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
var computer = entityManager.SpawnEntity(boardComponent.Prototype, transform.Coordinates);
computer.Transform.LocalRotation = transform.LocalRotation;

View File

@@ -61,7 +61,7 @@ namespace Content.Server.Construction.Completions
entBoardContainer.Remove(board);
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
var machine = entityManager.SpawnEntity(boardComponent.Prototype, transform.Coordinates);
machine.Transform.LocalRotation = transform.LocalRotation;

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Construction.Completions
if (!entityManager.TryGetComponent(uid, out ContainerManagerComponent? containerManager))
return;
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
foreach (var container in containerManager.GetAllContainers())
{
container.EmptyContainer(true, transform.Coordinates);

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Construction.Completions
!containerManager.TryGetContainer(Container, out var container)) return;
// TODO: Use container system methods.
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
foreach (var contained in container.ContainedEntities.ToArray())
{
container.ForceRemove(contained);

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Construction.Completions
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
transform.Anchored = Value;
}
}

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Construction.Completions
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
transform.Coordinates = transform.Coordinates.SnapToGrid(entityManager);
if (SouthRotation)

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Construction.Completions
if (string.IsNullOrEmpty(Prototype))
return;
var coordinates = entityManager.GetComponent<ITransformComponent>(uid).Coordinates;
var coordinates = entityManager.GetComponent<TransformComponent>(uid).Coordinates;
if (EntityPrototypeHelpers.HasComponent<StackComponent>(Prototype))
{

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Construction.Completions
var containerSystem = entityManager.EntitySysManager.GetEntitySystem<ContainerSystem>();
var container = containerSystem.EnsureContainer<Container>(uid, Container);
var coordinates = entityManager.GetComponent<ITransformComponent>(uid).Coordinates;
var coordinates = entityManager.GetComponent<TransformComponent>(uid).Coordinates;
for (var i = 0; i < Amount; i++)
{
container.Insert(entityManager.SpawnEntity(Prototype, coordinates));

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Construction.Conditions
var type = IoCManager.Resolve<IComponentFactory>().GetRegistration(Component).Type;
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
var indices = transform.Coordinates.ToVector2i(entityManager, IoCManager.Resolve<IMapManager>());
var entities = indices.GetEntitiesInTile(transform.GridID, LookupFlags.Approximate | LookupFlags.IncludeAnchored, IoCManager.Resolve<IEntityLookup>());

View File

@@ -19,7 +19,7 @@ namespace Content.Server.Construction.Conditions
public bool Condition(EntityUid uid, IEntityManager entityManager)
{
var transform = entityManager.GetComponent<ITransformComponent>(uid);
var transform = entityManager.GetComponent<TransformComponent>(uid);
return transform.Anchored && Anchored || !transform.Anchored && !Anchored;
}

View File

@@ -153,7 +153,7 @@ namespace Content.Server.Construction
private EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity,
ConstructionComponent? construction = null,
MetaDataComponent? metaData = null,
ITransformComponent? transform = null,
TransformComponent? transform = null,
ContainerManagerComponent? containerManager = null)
{
if (!Resolve(uid, ref construction, ref metaData, ref transform))
@@ -187,7 +187,7 @@ namespace Content.Server.Construction
}
// Transform transferring.
var newTransform = EntityManager.GetComponent<ITransformComponent>(newUid);
var newTransform = EntityManager.GetComponent<TransformComponent>(newUid);
newTransform.LocalRotation = transform.LocalRotation;
newTransform.Anchored = transform.Anchored;