using System.Text.RegularExpressions;
using Content.Shared.Tools;
using Content.Shared.Tools.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Configurable
{
///
/// Configuration for mailing units.
///
///
/// If you want a more detailed description ask the original coder.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ConfigurationComponent : Component
{
///
/// Tags for mail unit routing.
///
[DataField, AutoNetworkedField]
public Dictionary Config = new();
///
/// Quality to open up the configuration UI.
///
[DataField]
public ProtoId QualityNeeded = SharedToolSystem.PulseQuality;
///
/// Validate tags in .
///
[DataField]
public Regex Validation = new("^[a-zA-Z0-9 ]*$", RegexOptions.Compiled);
///
/// Message data sent from client to server when the device configuration is updated.
///
[Serializable, NetSerializable]
public sealed class ConfigurationUpdatedMessage : BoundUserInterfaceMessage
{
public Dictionary Config { get; }
public ConfigurationUpdatedMessage(Dictionary config)
{
Config = config;
}
}
[Serializable, NetSerializable]
public sealed class ValidationUpdateMessage : BoundUserInterfaceMessage
{
public string ValidationString { get; }
public ValidationUpdateMessage(string validationString)
{
ValidationString = validationString;
}
}
[Serializable, NetSerializable]
public enum ConfigurationUiKey
{
Key
}
}
}