Apc device network and apc based light switch (#4908)
* Remove WireNet node group from cables Implement extension cable components and system Remove connection over distance logic from ApcPower... components * Add extension cable components to prototypes * Implement ApcNetwork Implement ApcNetSwitch * Fix ignoredComponents.cs * Add friend attribute to new components * Add construction graph for a light switch * Address reviews * Fix broken test * Move ConnectionType enum to DeviceNetworkComponent Change netId data definition to use the ConnectionType enum values Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Content.Server.DeviceNetwork.Systems;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.DeviceNetwork.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(ApcNetworkSystem))]
|
||||
public class ApcNetworkComponent : Component
|
||||
{
|
||||
public override string Name => "ApcNetworkConnection";
|
||||
|
||||
/// <summary>
|
||||
/// The node Group the ApcNetworkConnection is connected to
|
||||
/// </summary>
|
||||
[ViewVariables] public Node? ConnectedNode;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -9,16 +10,22 @@ namespace Content.Server.DeviceNetwork.Components
|
||||
{
|
||||
public override string Name => "DeviceNetworkComponent";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The device networks netID this DeviceNetworkComponent connects to.
|
||||
/// The netID is used to seperate device networks that shouldn't interact with each other e.g. wireless and wired.
|
||||
/// The default netID's are_
|
||||
/// 0 -> Private
|
||||
/// 1 -> Wired
|
||||
/// 2 -> Wireless
|
||||
/// Valid device network NetIDs.
|
||||
/// The netID is used to separate device networks that shouldn't interact with each other e.g. wireless and wired.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public enum ConnectionType
|
||||
{
|
||||
Private,
|
||||
Wired,
|
||||
Wireless,
|
||||
Apc
|
||||
}
|
||||
|
||||
[DataField("deviceNetId")]
|
||||
public int DeviceNetId { get; set; } = (int)DeviceNetworkConstants.ConnectionType.Private;
|
||||
public ConnectionType DeviceNetId { get; set; } = ConnectionType.Private;
|
||||
|
||||
[DataField("frequency")]
|
||||
public int Frequency { get; set; } = 0;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using Content.Server.DeviceNetwork.Systems.Devices;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.DeviceNetwork.Components.Devices
|
||||
{
|
||||
[RegisterComponent]
|
||||
[Friend(typeof(ApcNetSwitchSystem))]
|
||||
public class ApcNetSwitchComponent : Component
|
||||
{
|
||||
public override string Name => "ApcNetSwitch";
|
||||
|
||||
[ViewVariables] public bool State;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user