using Content.Shared.Access;
using Content.Shared.Turrets;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.TurretController;
///
/// Attached to entities that can set data on linked turret-based entities
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedDeployableTurretControllerSystem))]
public sealed partial class DeployableTurretControllerComponent : Component
{
///
/// The states of the turrets linked to this entity, indexed by their device address.
///
[ViewVariables]
public Dictionary LinkedTurrets = new();
///
/// The current armament state of the linked turrets.
/// [-1: Inactive, 0: weapon mode A, 1: weapon mode B, etc]
///
[DataField, AutoNetworkedField]
public int ArmamentState = -1;
///
/// Access levels that are known to the entity.
///
[DataField]
public HashSet> AccessLevels = new();
///
///Access groups that are known to the entity.
///
[DataField]
public HashSet> AccessGroups = new();
///
/// Sound to play when denied access.
///
[DataField]
public SoundSpecifier AccessDeniedSound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
}
[Serializable, NetSerializable]
public sealed class DeployableTurretControllerBoundInterfaceMessage : BoundUserInterfaceMessage
{
public List<(string, string)> TurretStates;
public DeployableTurretControllerBoundInterfaceMessage(List<(string, string)> turretStates)
{
TurretStates = turretStates;
}
}
[Serializable, NetSerializable]
public sealed class DeployableTurretControllerBoundInterfaceState : BoundUserInterfaceState
{
public List<(string, string)> TurretStates;
public DeployableTurretControllerBoundInterfaceState(List<(string, string)> turretStates)
{
TurretStates = turretStates;
}
}
[Serializable, NetSerializable]
public sealed class DeployableTurretArmamentSettingChangedMessage : BoundUserInterfaceMessage
{
public int ArmamentState;
public DeployableTurretArmamentSettingChangedMessage(int armamentState)
{
ArmamentState = armamentState;
}
}
[Serializable, NetSerializable]
public sealed class DeployableTurretExemptAccessLevelChangedMessage : BoundUserInterfaceMessage
{
public HashSet> AccessLevels;
public bool Enabled;
public DeployableTurretExemptAccessLevelChangedMessage(HashSet> accessLevels, bool enabled)
{
AccessLevels = accessLevels;
Enabled = enabled;
}
}
[Serializable, NetSerializable]
public enum TurretControllerVisuals : byte
{
ControlPanel,
}
[Serializable, NetSerializable]
public enum DeployableTurretControllerUiKey : byte
{
Key,
}