using Content.Server.NodeContainer;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.Power.EntitySystems;
using Content.Shared.NodeContainer;
using Content.Shared.Power;
namespace Content.Server.Power.Components;
///
/// Used to flag any entities that should appear on a power monitoring console
///
[RegisterComponent, Access(typeof(PowerMonitoringConsoleSystem))]
public sealed partial class PowerMonitoringDeviceComponent : Component
{
///
/// Name of the node that this device draws its power from (see )
///
[DataField("sourceNode"), ViewVariables]
public string SourceNode = string.Empty;
///
/// Name of the node that this device distributes power to (see )
///
[DataField("loadNode"), ViewVariables]
public string LoadNode = string.Empty;
///
/// Names of the nodes that this device can potentially distributes power to (see )
///
[DataField("loadNodes"), ViewVariables]
public List? LoadNodes;
///
/// This entity will be grouped with entities that have the same collection name
///
[DataField("collectionName"), ViewVariables]
public string CollectionName = string.Empty;
[ViewVariables]
public BaseNodeGroup? NodeGroup = null;
///
/// Indicates whether the entity is/should be part of a collection
///
public bool IsCollectionMasterOrChild { get { return CollectionName != string.Empty; } }
///
/// Specifies the uid of the master that represents this entity
///
///
/// Used when grouping multiple entities into a single power monitoring console entry
///
[ViewVariables]
public EntityUid CollectionMaster;
///
/// Indicates if this entity represents a group of entities
///
///
/// Used when grouping multiple entities into a single power monitoring console entry
///
public bool IsCollectionMaster { get { return Owner == CollectionMaster; } }
///
/// A list of other entities that are to be represented by this entity
///
/// ///
/// Used when grouping multiple entities into a single power monitoring console entry
///
[ViewVariables]
public Dictionary ChildDevices = new();
///
/// Path to the .rsi folder
///
[DataField("sprite"), ViewVariables]
public string SpritePath = string.Empty;
///
/// The .rsi state
///
[DataField("state"), ViewVariables]
public string SpriteState = string.Empty;
///
/// Determines what power monitoring group this entity should belong to
///
[DataField("group", required: true), ViewVariables]
public PowerMonitoringConsoleGroup Group;
}