SetAnchor.cs 551 B

123456789101112131415161718
  1. using Content.Shared.Construction;
  2. using JetBrains.Annotations;
  3. namespace Content.Server.Construction.Completions
  4. {
  5. [UsedImplicitly]
  6. [DataDefinition]
  7. public sealed partial class SetAnchor : IGraphAction
  8. {
  9. [DataField("value")] public bool Value { get; private set; } = true;
  10. public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
  11. {
  12. var transform = entityManager.GetComponent<TransformComponent>(uid);
  13. transform.Anchored = Value;
  14. }
  15. }
  16. }