Files
tbd-station-14/Content.Server/Construction/Completions/SetAnchor.cs
Pieter-Jan Briers 1eb0fbd8d0 Revert "Physics (#3452)"
This reverts commit 3e64fd56a1.
2021-02-28 18:49:48 +01:00

28 lines
735 B
C#

#nullable enable
using System.Threading.Tasks;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Server.Construction.Completions
{
[UsedImplicitly]
public class SetAnchor : IGraphAction
{
void IExposeData.ExposeData(ObjectSerializer serializer)
{
serializer.DataField(this, x => x.Value, "value", true);
}
public bool Value { get; private set; } = true;
public async Task PerformAction(IEntity entity, IEntity? user)
{
if (!entity.TryGetComponent(out IPhysicsComponent? physics)) return;
physics.Anchored = Value;
}
}
}