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

@@ -24,8 +24,8 @@ namespace Content.Client.Animations
{ {
new AnimationTrackComponentProperty new AnimationTrackComponentProperty
{ {
ComponentType = typeof(ITransformComponent), ComponentType = typeof(TransformComponent),
Property = nameof(ITransformComponent.LocalRotation), Property = nameof(TransformComponent.LocalRotation),
InterpolationMode = AnimationInterpolationMode.Linear, InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames = KeyFrames =
{ {

View File

@@ -36,8 +36,8 @@ namespace Content.Client.Animations
{ {
new AnimationTrackComponentProperty new AnimationTrackComponentProperty
{ {
ComponentType = typeof(ITransformComponent), ComponentType = typeof(TransformComponent),
Property = nameof(ITransformComponent.LocalPosition), Property = nameof(TransformComponent.LocalPosition),
InterpolationMode = AnimationInterpolationMode.Linear, InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames = KeyFrames =
{ {

View File

@@ -61,7 +61,7 @@ namespace Content.Client.Atmos.Visualizers
{ {
base.OnChangeData(component); base.OnChangeData(component);
if (!component.Owner.TryGetComponent<ITransformComponent>(out var xform)) if (!component.Owner.TryGetComponent<TransformComponent>(out var xform))
return; return;
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite)) if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite))

View File

@@ -48,7 +48,7 @@ namespace Content.Client.Popups
if (!EntityManager.EntityExists(uid)) if (!EntityManager.EntityExists(uid))
return; return;
var transform = EntityManager.GetComponent<ITransformComponent>(uid); var transform = EntityManager.GetComponent<TransformComponent>(uid);
PopupMessage(message, _eyeManager.CoordinatesToScreen(transform.Coordinates)); PopupMessage(message, _eyeManager.CoordinatesToScreen(transform.Coordinates));
} }

View File

@@ -28,8 +28,8 @@ namespace Content.IntegrationTests.Tests.Disposal
SubscribeLocalEvent<DoInsertDisposalUnitEvent>(ev => SubscribeLocalEvent<DoInsertDisposalUnitEvent>(ev =>
{ {
var (_, toInsert, unit) = ev; var (_, toInsert, unit) = ev;
var insertTransform = EntityManager.GetComponent<ITransformComponent>(toInsert); var insertTransform = EntityManager.GetComponent<TransformComponent>(toInsert);
var unitTransform = EntityManager.GetComponent<ITransformComponent>(unit); var unitTransform = EntityManager.GetComponent<TransformComponent>(unit);
// Not in a tube yet // Not in a tube yet
Assert.That(insertTransform.Parent, Is.EqualTo(unitTransform)); Assert.That(insertTransform.Parent, Is.EqualTo(unitTransform));
}, after: new[] {typeof(SharedDisposalUnitSystem)}); }, after: new[] {typeof(SharedDisposalUnitSystem)});

View File

@@ -31,7 +31,7 @@ namespace Content.Server.Administration.Commands
var entityManager = IoCManager.Resolve<IEntityManager>(); var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.TryGetComponent<ITransformComponent>(entityUid, out var transform)) return; if (!entityManager.TryGetComponent<TransformComponent>(entityUid, out var transform)) return;
var parent = transform.ParentUid; var parent = transform.ParentUid;

View File

@@ -32,7 +32,7 @@ namespace Content.Server.Administration.Commands
var entityManager = IoCManager.Resolve<IEntityManager>(); var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.TryGetComponent<ITransformComponent>(entityUid, out var transform)) return; if (!entityManager.TryGetComponent<TransformComponent>(entityUid, out var transform)) return;
var parent = transform.ParentUid; var parent = transform.ParentUid;

View File

@@ -32,7 +32,7 @@ namespace Content.Server.Administration.Commands
var entityManager = IoCManager.Resolve<IEntityManager>(); var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.TryGetComponent<ITransformComponent>(entityUid, out var transform)) return; if (!entityManager.TryGetComponent<TransformComponent>(entityUid, out var transform)) return;
var parent = transform.ParentUid; var parent = transform.ParentUid;

View File

@@ -70,7 +70,7 @@ namespace Content.Server.Atmos.EntitySystems
_timer -= UpdateTimer; _timer -= UpdateTimer;
foreach (var (barotrauma, damageable, transform) in EntityManager.EntityQuery<BarotraumaComponent, DamageableComponent, ITransformComponent>(false)) foreach (var (barotrauma, damageable, transform) in EntityManager.EntityQuery<BarotraumaComponent, DamageableComponent, TransformComponent>(false))
{ {
var totalDamage = FixedPoint2.Zero; var totalDamage = FixedPoint2.Zero;
foreach (var (barotraumaDamageType, _) in barotrauma.Damage.DamageDict) foreach (var (barotraumaDamageType, _) in barotrauma.Damage.DamageDict)

View File

@@ -187,7 +187,7 @@ namespace Content.Server.Atmos.EntitySystems
_timer -= UpdateTime; _timer -= UpdateTime;
// TODO: This needs cleanup to take off the crust from TemperatureComponent and shit. // TODO: This needs cleanup to take off the crust from TemperatureComponent and shit.
foreach (var (flammable, physics, transform) in EntityManager.EntityQuery<FlammableComponent, IPhysBody, ITransformComponent>()) foreach (var (flammable, physics, transform) in EntityManager.EntityQuery<FlammableComponent, IPhysBody, TransformComponent>())
{ {
var uid = flammable.Owner.Uid; var uid = flammable.Owner.Uid;

View File

@@ -51,7 +51,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
/// <summary> /// <summary>
/// Completely dumps the content of the canister into the world. /// Completely dumps the content of the canister into the world.
/// </summary> /// </summary>
public void PurgeContents(EntityUid uid, GasCanisterComponent? canister = null, ITransformComponent? transform = null) public void PurgeContents(EntityUid uid, GasCanisterComponent? canister = null, TransformComponent? transform = null)
{ {
if (!Resolve(uid, ref canister, ref transform)) return; if (!Resolve(uid, ref canister, ref transform)) return;

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
private void OnPortableAnchorAttempt(EntityUid uid, GasPortableComponent component, AnchorAttemptEvent args) private void OnPortableAnchorAttempt(EntityUid uid, GasPortableComponent component, AnchorAttemptEvent args)
{ {
if (!EntityManager.TryGetComponent(uid, out ITransformComponent? transform)) if (!EntityManager.TryGetComponent(uid, out TransformComponent? transform))
return; return;
// If we can't find any ports, cancel the anchoring. // If we can't find any ports, cancel the anchoring.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Construction.Completions
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) 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); transform.Coordinates = transform.Coordinates.SnapToGrid(entityManager);
if (SouthRotation) if (SouthRotation)

View File

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

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Construction.Completions
var containerSystem = entityManager.EntitySysManager.GetEntitySystem<ContainerSystem>(); var containerSystem = entityManager.EntitySysManager.GetEntitySystem<ContainerSystem>();
var container = containerSystem.EnsureContainer<Container>(uid, Container); 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++) for (var i = 0; i < Amount; i++)
{ {
container.Insert(entityManager.SpawnEntity(Prototype, coordinates)); 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 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 indices = transform.Coordinates.ToVector2i(entityManager, IoCManager.Resolve<IMapManager>());
var entities = indices.GetEntitiesInTile(transform.GridID, LookupFlags.Approximate | LookupFlags.IncludeAnchored, IoCManager.Resolve<IEntityLookup>()); 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) 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; 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, private EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity,
ConstructionComponent? construction = null, ConstructionComponent? construction = null,
MetaDataComponent? metaData = null, MetaDataComponent? metaData = null,
ITransformComponent? transform = null, TransformComponent? transform = null,
ContainerManagerComponent? containerManager = null) ContainerManagerComponent? containerManager = null)
{ {
if (!Resolve(uid, ref construction, ref metaData, ref transform)) if (!Resolve(uid, ref construction, ref metaData, ref transform))
@@ -187,7 +187,7 @@ namespace Content.Server.Construction
} }
// Transform transferring. // Transform transferring.
var newTransform = EntityManager.GetComponent<ITransformComponent>(newUid); var newTransform = EntityManager.GetComponent<TransformComponent>(newUid);
newTransform.LocalRotation = transform.LocalRotation; newTransform.LocalRotation = transform.LocalRotation;
newTransform.Anchored = transform.Anchored; newTransform.Anchored = transform.Anchored;

View File

@@ -42,13 +42,13 @@ namespace Content.Server.DoAfter
if (eventArgs.BreakOnUserMove) if (eventArgs.BreakOnUserMove)
{ {
UserGrid = entityManager.GetComponent<ITransformComponent>(eventArgs.User).Coordinates; UserGrid = entityManager.GetComponent<TransformComponent>(eventArgs.User).Coordinates;
} }
if (eventArgs.BreakOnTargetMove) if (eventArgs.BreakOnTargetMove)
{ {
// Target should never be null if the bool is set. // Target should never be null if the bool is set.
TargetGrid = entityManager.GetComponent<ITransformComponent>(eventArgs.Target!.Value).Coordinates; TargetGrid = entityManager.GetComponent<TransformComponent>(eventArgs.Target!.Value).Coordinates;
} }
// For this we need to stay on the same hand slot and need the same item in that hand slot // For this we need to stay on the same hand slot and need the same item in that hand slot
@@ -113,13 +113,13 @@ namespace Content.Server.DoAfter
} }
// TODO :Handle inertia in space. // TODO :Handle inertia in space.
if (EventArgs.BreakOnUserMove && !entityManager.GetComponent<ITransformComponent>(EventArgs.User).Coordinates.InRange( if (EventArgs.BreakOnUserMove && !entityManager.GetComponent<TransformComponent>(EventArgs.User).Coordinates.InRange(
entityManager, UserGrid, EventArgs.MovementThreshold)) entityManager, UserGrid, EventArgs.MovementThreshold))
{ {
return true; return true;
} }
if (EventArgs.BreakOnTargetMove && !entityManager.GetComponent<ITransformComponent>(EventArgs.Target!.Value).Coordinates.InRange( if (EventArgs.BreakOnTargetMove && !entityManager.GetComponent<TransformComponent>(EventArgs.Target!.Value).Coordinates.InRange(
entityManager, TargetGrid, EventArgs.MovementThreshold)) entityManager, TargetGrid, EventArgs.MovementThreshold))
{ {
return true; return true;

View File

@@ -139,7 +139,7 @@ namespace Content.Server.Electrocution
public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid, public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid,
ElectrifiedComponent? electrified = null, ElectrifiedComponent? electrified = null,
NodeContainerComponent? nodeContainer = null, NodeContainerComponent? nodeContainer = null,
ITransformComponent? transform = null) TransformComponent? transform = null)
{ {
if (!Resolve(uid, ref electrified, ref transform, false)) if (!Resolve(uid, ref electrified, ref transform, false))
return false; return false;
@@ -253,7 +253,7 @@ namespace Content.Server.Electrocution
float siemensCoefficient = 1f, float siemensCoefficient = 1f,
StatusEffectsComponent? statusEffects = null, StatusEffectsComponent? statusEffects = null,
SharedAlertsComponent? alerts = null, SharedAlertsComponent? alerts = null,
ITransformComponent? sourceTransform = null) TransformComponent? sourceTransform = null)
{ {
if (!DoCommonElectrocutionAttempt(uid, sourceUid, ref siemensCoefficient)) if (!DoCommonElectrocutionAttempt(uid, sourceUid, ref siemensCoefficient))
return false; return false;

View File

@@ -151,7 +151,7 @@ namespace Content.Server.Flash
public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0f, bool displayPopup = false, SoundSpecifier? sound = null) public void FlashArea(EntityUid source, EntityUid? user, float range, float duration, float slowTo = 0f, bool displayPopup = false, SoundSpecifier? sound = null)
{ {
var transform = EntityManager.GetComponent<ITransformComponent>(source); var transform = EntityManager.GetComponent<TransformComponent>(source);
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range)) foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
{ {

View File

@@ -64,7 +64,7 @@ namespace Content.Server.GameTicking
throw new InvalidOperationException($"No grid found for map {map}"); throw new InvalidOperationException($"No grid found for map {map}");
} }
var stationXform = EntityManager.GetComponent<ITransformComponent>(grid.GridEntityId); var stationXform = EntityManager.GetComponent<TransformComponent>(grid.GridEntityId);
if (StationOffset) if (StationOffset)
{ {

View File

@@ -256,7 +256,7 @@ namespace Content.Server.GameTicking
_possiblePositions.Clear(); _possiblePositions.Clear();
foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, ITransformComponent>()) foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, TransformComponent>())
{ {
if (point.SpawnType == SpawnPointType.Job && point.Job?.ID == jobId) if (point.SpawnType == SpawnPointType.Job && point.Job?.ID == jobId)
_possiblePositions.Add(transform.Coordinates); _possiblePositions.Add(transform.Coordinates);
@@ -274,7 +274,7 @@ namespace Content.Server.GameTicking
_possiblePositions.Clear(); _possiblePositions.Clear();
foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, ITransformComponent>()) foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, TransformComponent>())
{ {
if (point.SpawnType == SpawnPointType.LateJoin) _possiblePositions.Add(transform.Coordinates); if (point.SpawnType == SpawnPointType.LateJoin) _possiblePositions.Add(transform.Coordinates);
} }
@@ -292,7 +292,7 @@ namespace Content.Server.GameTicking
_possiblePositions.Clear(); _possiblePositions.Clear();
foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, ITransformComponent>()) foreach (var (point, transform) in EntityManager.EntityQuery<SpawnPointComponent, TransformComponent>())
{ {
if (point.SpawnType == SpawnPointType.Observer) if (point.SpawnType == SpawnPointType.Observer)
_possiblePositions.Add(transform.Coordinates); _possiblePositions.Add(transform.Coordinates);

View File

@@ -48,7 +48,7 @@ namespace Content.Server.Pinpointer
/// Will return null if can't find anything /// Will return null if can't find anything
/// </summary> /// </summary>
private EntityUid? FindTargetFromWhitelist(EntityUid uid, EntityWhitelist whitelist, private EntityUid? FindTargetFromWhitelist(EntityUid uid, EntityWhitelist whitelist,
ITransformComponent? transform = null) TransformComponent? transform = null)
{ {
if (!Resolve(uid, ref transform)) if (!Resolve(uid, ref transform))
return null; return null;
@@ -125,9 +125,9 @@ namespace Content.Server.Pinpointer
private Vector2? CalculateDirection(EntityUid pinUid, EntityUid trgUid) private Vector2? CalculateDirection(EntityUid pinUid, EntityUid trgUid)
{ {
// check if entities have transform component // check if entities have transform component
if (!EntityManager.TryGetComponent(pinUid, out ITransformComponent? pin)) if (!EntityManager.TryGetComponent(pinUid, out TransformComponent? pin))
return null; return null;
if (!EntityManager.TryGetComponent(trgUid, out ITransformComponent? trg)) if (!EntityManager.TryGetComponent(trgUid, out TransformComponent? trg))
return null; return null;
// check if they are on same map // check if they are on same map

View File

@@ -37,7 +37,7 @@ namespace Content.Server.Pointing.EntitySystems
} }
} }
private IEntity? RandomNearbyPlayer(EntityUid uid, RoguePointingArrowComponent? component = null, ITransformComponent? transform = null) private IEntity? RandomNearbyPlayer(EntityUid uid, RoguePointingArrowComponent? component = null, TransformComponent? transform = null)
{ {
if (!Resolve(uid, ref component, ref transform)) if (!Resolve(uid, ref component, ref transform))
return null; return null;
@@ -55,7 +55,7 @@ namespace Content.Server.Pointing.EntitySystems
return _random.Pick(players).AttachedEntity; return _random.Pick(players).AttachedEntity;
} }
private void UpdateAppearance(EntityUid uid, RoguePointingArrowComponent? component = null, ITransformComponent? transform = null, AppearanceComponent? appearance = null) private void UpdateAppearance(EntityUid uid, RoguePointingArrowComponent? component = null, TransformComponent? transform = null, AppearanceComponent? appearance = null)
{ {
if (!Resolve(uid, ref component, ref transform, ref appearance) || component.Chasing == null) if (!Resolve(uid, ref component, ref transform, ref appearance) || component.Chasing == null)
return; return;
@@ -65,7 +65,7 @@ namespace Content.Server.Pointing.EntitySystems
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
foreach (var (component, transform) in EntityManager.EntityQuery<RoguePointingArrowComponent, ITransformComponent>()) foreach (var (component, transform) in EntityManager.EntityQuery<RoguePointingArrowComponent, TransformComponent>())
{ {
var uid = component.Owner.Uid; var uid = component.Owner.Uid;
component.Chasing ??= RandomNearbyPlayer(uid, component, transform); component.Chasing ??= RandomNearbyPlayer(uid, component, transform);

View File

@@ -49,7 +49,7 @@ namespace Content.Server.Power.EntitySystems
var mask = WireVisDirFlags.None; var mask = WireVisDirFlags.None;
var transform = EntityManager.GetComponent<ITransformComponent>(uid); var transform = EntityManager.GetComponent<TransformComponent>(uid);
// Only valid grids allowed. // Only valid grids allowed.
if(!transform.GridID.IsValid()) if(!transform.GridID.IsValid())

View File

@@ -52,7 +52,7 @@ namespace Content.Server.Tabletop
// TODO: some permission system, disallow movement if you're not permitted to move the item // TODO: some permission system, disallow movement if you're not permitted to move the item
// Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map) // Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map)
var transform = EntityManager.GetComponent<ITransformComponent>(movedEntity.Uid); var transform = EntityManager.GetComponent<TransformComponent>(movedEntity.Uid);
var entityCoordinates = new EntityCoordinates(_mapManager.GetMapEntityId(transform.MapID), msg.Coordinates.Position); var entityCoordinates = new EntityCoordinates(_mapManager.GetMapEntityId(transform.MapID), msg.Coordinates.Position);
transform.Coordinates = entityCoordinates; transform.Coordinates = entityCoordinates;
} }

View File

@@ -113,7 +113,7 @@ namespace Content.Server.Tools
SoundSystem.Play(Filter.Pvs(uid), welder.WelderOnSounds.GetSound(), uid, AudioHelpers.WithVariation(0.125f).WithVolume(-5f)); SoundSystem.Play(Filter.Pvs(uid), welder.WelderOnSounds.GetSound(), uid, AudioHelpers.WithVariation(0.125f).WithVolume(-5f));
// TODO: Use ITransformComponent directly. // TODO: Use TransformComponent directly.
_atmosphereSystem.HotspotExpose(welder.Owner.Transform.Coordinates, 700, 50, true); _atmosphereSystem.HotspotExpose(welder.Owner.Transform.Coordinates, 700, 50, true);
welder.Dirty(); welder.Dirty();
@@ -316,7 +316,7 @@ namespace Content.Server.Tools
if (!_solutionContainerSystem.TryGetSolution(tool, welder.FuelSolution, out var solution, solutionContainer)) if (!_solutionContainerSystem.TryGetSolution(tool, welder.FuelSolution, out var solution, solutionContainer))
continue; continue;
// TODO: Use ITransformComponent directly. // TODO: Use TransformComponent directly.
_atmosphereSystem.HotspotExpose(welder.Owner.Transform.Coordinates, 700, 50, true); _atmosphereSystem.HotspotExpose(welder.Owner.Transform.Coordinates, 700, 50, true);
solution.RemoveReagent(welder.FuelReagent, welder.FuelConsumption * _welderTimer); solution.RemoveReagent(welder.FuelReagent, welder.FuelConsumption * _welderTimer);

View File

@@ -169,7 +169,7 @@ namespace Content.Shared.Movement
/// <summary> /// <summary>
/// Used for weightlessness to determine if we are near a wall. /// Used for weightlessness to determine if we are near a wall.
/// </summary> /// </summary>
public static bool IsAroundCollider(SharedPhysicsSystem broadPhaseSystem, ITransformComponent transform, IMobMoverComponent mover, IPhysBody collider) public static bool IsAroundCollider(SharedPhysicsSystem broadPhaseSystem, TransformComponent transform, IMobMoverComponent mover, IPhysBody collider)
{ {
var enlargedAABB = collider.GetWorldAABB().Enlarged(mover.GrabRange); var enlargedAABB = collider.GetWorldAABB().Enlarged(mover.GrabRange);

View File

@@ -142,7 +142,7 @@ namespace Content.Shared.SubFloor
private void UpdateEntity(EntityUid uid) private void UpdateEntity(EntityUid uid)
{ {
var transform = EntityManager.GetComponent<ITransformComponent>(uid); var transform = EntityManager.GetComponent<TransformComponent>(uid);
if (!_mapManager.TryGetGrid(transform.GridID, out var grid)) if (!_mapManager.TryGetGrid(transform.GridID, out var grid))
{ {
@@ -175,7 +175,7 @@ namespace Content.Shared.SubFloor
subFloor = true; subFloor = true;
} }
// We only need to query the TransformComp if the SubfloorHide is enabled and requires anchoring. // We only need to query the TransformComp if the SubfloorHide is enabled and requires anchoring.
else if (subFloorHideComponent.RequireAnchored && EntityManager.TryGetComponent(uid, out ITransformComponent? transformComponent)) else if (subFloorHideComponent.RequireAnchored && EntityManager.TryGetComponent(uid, out TransformComponent? transformComponent))
{ {
// If we require the entity to be anchored but it's not, this will set subfloor to true, unhiding it. // If we require the entity to be anchored but it's not, this will set subfloor to true, unhiding it.
subFloor = !transformComponent.Anchored; subFloor = !transformComponent.Anchored;

View File

@@ -4,7 +4,7 @@ namespace Content.Shared.Transform
{ {
public static class TransformExtensions public static class TransformExtensions
{ {
public static void AttachToGrandparent(this ITransformComponent transform) public static void AttachToGrandparent(this TransformComponent transform)
{ {
var grandParent = transform.Parent?.Parent; var grandParent = transform.Parent?.Parent;