Resolves SmesVisualizer is Obsolete (#13899)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
TemporalOroboros
2023-05-06 20:43:41 -07:00
committed by GitHub
parent 5628ee36dd
commit 6ff63a6ee7
8 changed files with 120 additions and 97 deletions

View File

@@ -1,16 +1,12 @@
using Content.Server.Power.Components;
using Content.Shared.Power;
using Content.Shared.Rounding;
using Content.Shared.SMES;
using Robust.Server.GameObjects;
using Robust.Shared.Timing;
namespace Content.Server.Power.SMES;
/// <summary>
/// Handles the "user-facing" side of the actual SMES object.
/// This is operations that are specific to the SMES, like UI and visuals.
/// Logic is handled in <see cref="PowerSmesSystem"/>
/// Logic is handled in <see cref="SmesSystem"/>
/// Code interfacing with the powernet is handled in <see cref="BatteryStorageComponent"/> and <see cref="BatteryDischargerComponent"/>.
/// </summary>
[RegisterComponent, Access(typeof(SmesSystem))]
@@ -26,4 +22,23 @@ public sealed class SmesComponent : Component
public TimeSpan LastChargeLevelTime;
[ViewVariables]
public TimeSpan VisualsChangeDelay = TimeSpan.FromSeconds(1);
/// <summary>
/// The number of distinct charge levels a SMES has.
/// 0 is empty max is full.
/// </summary>
[DataField("numChargeLevels")]
public int NumChargeLevels = 6;
/// <summary>
/// The charge level of the SMES as of the most recent update.
/// </summary>
[ViewVariables]
public int ChargeLevel = 0;
/// <summary>
/// Whether the SMES is being charged/discharged/neither.
/// </summary>
[ViewVariables]
public ChargeState ChargeState = ChargeState.Still;
}