Files
tbd-station-14/Content.Server/Charges/Components/AutoRechargeComponent.cs
Pieter-Jan Briers e00f74505c Use new ComponentPauseGenerator (#25183)
Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
2024-02-26 14:36:19 +11:00

27 lines
915 B
C#

using Content.Server.Charges.Systems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Charges.Components;
/// <summary>
/// Something with limited charges that can be recharged automatically.
/// Requires LimitedChargesComponent to function.
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(ChargesSystem))]
public sealed partial class AutoRechargeComponent : Component
{
/// <summary>
/// The time it takes to regain a single charge
/// </summary>
[DataField("rechargeDuration"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan RechargeDuration = TimeSpan.FromSeconds(90);
/// <summary>
/// The time when the next charge will be added
/// </summary>
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextChargeTime;
}