Files
tbd-station-14/Content.Shared/Power/Components/BatterySelfRechargerComponent.cs
slarticodefast 7155d0d291 Cleanup BatterySystem (#41298)
* cleanup

* fix fixtures

* this belongs into the next PR

* review

* misc

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2025-11-08 20:55:02 +00:00

37 lines
1.1 KiB
C#

using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Power.Components;
/// <summary>
/// Self-recharging battery.
/// To be used in combination with <see cref="BatteryComponent"/>.
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class BatterySelfRechargerComponent : Component
{
/// <summary>
/// Is the component currently enabled?
/// </summary>
[DataField]
public bool AutoRecharge = true;
/// <summary>
/// At what rate does the entity automatically recharge?
/// </summary>
[DataField]
public float AutoRechargeRate;
/// <summary>
/// How long should the entity stop automatically recharging if charge is used?
/// </summary>
[DataField]
public TimeSpan AutoRechargePauseTime = TimeSpan.FromSeconds(0);
/// <summary>
/// Do not auto recharge if this timestamp has yet to happen, set for the auto recharge pause system.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextAutoRecharge = TimeSpan.FromSeconds(0);
}