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.
/// This is used to populate the controller UI with the address and state of linked turrets.
///
[ViewVariables]
public Dictionary LinkedTurrets = new();
///
/// The last armament state index applied to any linked turrets.
/// Values greater than zero have no additional effect if the linked turrets
/// do not have the
///
///
/// -1: Inactive, 0: weapon mode A, 1: weapon mode B, etc.
///
[DataField, AutoNetworkedField]
public int ArmamentState = -1;
///
/// Access level prototypes that are known to the entity.
/// Determines what access permissions can be adjusted.
/// It is also used to populate the controller UI.
///
[DataField]
public HashSet> AccessLevels = new();
///
/// Access group prototypes that are known to the entity.
/// Determines how access permissions are organized on the controller UI.
///
[DataField]
public HashSet> AccessGroups = new();
///
/// Sound to play when denying access to the device.
///
[DataField]
public SoundSpecifier AccessDeniedSound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
}
[Serializable, NetSerializable]
public sealed class DeployableTurretControllerBoundInterfaceState : BoundUserInterfaceState
{
public Dictionary TurretStateByAddress;
public DeployableTurretControllerBoundInterfaceState(Dictionary turretStateByAddress)
{
TurretStateByAddress = turretStateByAddress;
}
}
[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,
}