2020-12-03 22:49:00 +01:00
|
|
|
|
#nullable enable
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Content.Server.GameObjects.Components.Construction;
|
|
|
|
|
|
using Content.Shared.Construction;
|
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
2021-02-04 17:44:49 +01:00
|
|
|
|
using Robust.Shared.Interfaces.Serialization;
|
2020-12-03 22:49:00 +01:00
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Construction.Completions
|
|
|
|
|
|
{
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
|
public class MachineFrameRegenerateProgress : IGraphAction
|
|
|
|
|
|
{
|
2021-02-04 17:44:49 +01:00
|
|
|
|
void IExposeData.ExposeData(ObjectSerializer serializer)
|
2020-12-03 22:49:00 +01:00
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
public async Task PerformAction(IEntity entity, IEntity? user)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (entity.Deleted)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (entity.TryGetComponent<MachineFrameComponent>(out var machineFrame))
|
|
|
|
|
|
{
|
|
|
|
|
|
machineFrame.RegenerateProgress();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|