Files
ss14-wega/Content.Shared/Power/Components/PredictedBatterySelfRechargerComponent.cs
slarticodefast e2ff167062 Predict powercells, chargers and PowerCellDraw (#41379)
* cleanup

* fix fixtures

* prediction

* fix test

* review

* fix svalinn visuals

* fix chargers

* fix portable recharger and its unlit visuals

* fix borgs

* oomba review

* fix examination prediction
2025-11-24 16:52:11 +00:00

34 lines
1.3 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="PredictedBatteryComponent"/>.
/// For <see cref="BatteryComponent"/> use <see cref="BatterySelfRechargerComponent"/> instead.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class PredictedBatterySelfRechargerComponent : 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);
}