using Content.Shared.Security; using Content.Shared.StationRecords; using Robust.Shared.Serialization; namespace Content.Shared.CriminalRecords; [Serializable, NetSerializable] public enum CriminalRecordsConsoleKey : byte { Key } /// /// Criminal records console state. There are a few states: /// - SelectedKey null, Record null, RecordListing null /// - The station record database could not be accessed. /// - SelectedKey null, Record null, RecordListing non-null /// - Records are populated in the database, or at least the station has /// the correct component. /// - SelectedKey non-null, Record null, RecordListing non-null /// - The selected key does not have a record tied to it. /// - SelectedKey non-null, Record non-null, RecordListing non-null /// - The selected key has a record tied to it, and the record has been sent. /// /// - there is added new filters and so added new states /// -SelectedKey null, Record null, RecordListing null, filters non-null /// the station may have data, but they all did not pass through the filters /// /// Other states are erroneous. /// [Serializable, NetSerializable] public sealed class CriminalRecordsConsoleState : BoundUserInterfaceState { /// /// Currently selected crewmember record key. /// public uint? SelectedKey = null; public CriminalRecord? CriminalRecord = null; public GeneralStationRecord? StationRecord = null; public SecurityStatus FilterStatus = SecurityStatus.None; public readonly Dictionary? RecordListing; public readonly StationRecordsFilter? Filter; public CriminalRecordsConsoleState(Dictionary? recordListing, StationRecordsFilter? newFilter) { RecordListing = recordListing; Filter = newFilter; } /// /// Default state for opening the console /// public CriminalRecordsConsoleState() : this(null, null) { } public bool IsEmpty() => SelectedKey == null && StationRecord == null && CriminalRecord == null && RecordListing == null; } /// /// Used to change status, respecting the wanted/reason nullability rules in . /// [Serializable, NetSerializable] public sealed class CriminalRecordChangeStatus : BoundUserInterfaceMessage { public readonly SecurityStatus Status; public readonly string? Reason; public CriminalRecordChangeStatus(SecurityStatus status, string? reason) { Status = status; Reason = reason; } } /// /// Used to add a single line to the record's crime history. /// [Serializable, NetSerializable] public sealed class CriminalRecordAddHistory : BoundUserInterfaceMessage { public readonly string Line; public CriminalRecordAddHistory(string line) { Line = line; } } /// /// Used to delete a single line from the crime history, by index. /// [Serializable, NetSerializable] public sealed class CriminalRecordDeleteHistory : BoundUserInterfaceMessage { public readonly uint Index; public CriminalRecordDeleteHistory(uint index) { Index = index; } } /// /// Used to set what status to filter by index. /// /// /// [Serializable, NetSerializable] public sealed class CriminalRecordSetStatusFilter : BoundUserInterfaceMessage { public readonly SecurityStatus FilterStatus; public CriminalRecordSetStatusFilter(SecurityStatus newFilterStatus) { FilterStatus = newFilterStatus; } }