Files
Delta-v/Content.Shared/Power/Components/BatterySelfRechargerComponent.cs
T
slarticodefastandPrincess Cheeseballs 17ff77b61f Unify BatteryComponent and PredictedBatteryComponent (#41867)
* unify

* cleanup and merge conflicts

* floating points

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2026-01-26 19:25:32 +01:00

33 lines
1.2 KiB
C#

using Robust.Shared.GameStates;
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, NetworkedComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class BatterySelfRechargerComponent : Component
{
/// <summary>
/// At what rate does the entity automatically recharge? In watts.
/// </summary>
[DataField, AutoNetworkedField, ViewVariables]
public float AutoRechargeRate;
/// <summary>
/// How long should the entity stop automatically recharging if a charge is used?
/// </summary>
[DataField, AutoNetworkedField]
public TimeSpan AutoRechargePauseTime = TimeSpan.Zero;
/// <summary>
/// Do not auto recharge if this timestamp has yet to happen, set for the auto recharge pause system.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField, AutoPausedField, ViewVariables]
public TimeSpan? NextAutoRecharge = TimeSpan.FromSeconds(0);
}