using Robust.Shared.Serialization; namespace Content.Shared.CartridgeLoader.Cartridges; /// /// The priority assigned to a NanoTask item /// [Serializable, NetSerializable] public enum NanoTaskPriority : byte { High, Medium, Low, }; /// /// The data relating to a single NanoTask item, but not its identifier /// [Serializable, NetSerializable, DataRecord] public sealed class NanoTaskItem { /// /// The maximum length of the Description and TaskIsFor fields /// public static int MaximumStringLength = 30; /// /// The task description, i.e. "Bake a cake" /// public readonly string Description; /// /// Who the task is for, i.e. "Cargo" /// public readonly string TaskIsFor; /// /// If the task is marked as done or not /// public readonly bool IsTaskDone; /// /// The task's marked priority /// public readonly NanoTaskPriority Priority; public NanoTaskItem(string description, string taskIsFor, bool isTaskDone, NanoTaskPriority priority) { Description = description; TaskIsFor = taskIsFor; IsTaskDone = isTaskDone; Priority = priority; } public bool Validate() { return Description.Length <= MaximumStringLength && TaskIsFor.Length <= MaximumStringLength; } }; /// /// Pairs a NanoTask item and its identifier /// [Serializable, NetSerializable, DataRecord] public sealed class NanoTaskItemAndId { public readonly int Id; public readonly NanoTaskItem Data; public NanoTaskItemAndId(int id, NanoTaskItem data) { Id = id; Data = data; } }; /// /// The UI state of the NanoTask /// [Serializable, NetSerializable] public sealed class NanoTaskUiState : BoundUserInterfaceState { public List Tasks; public NanoTaskUiState(List tasks) { Tasks = tasks; } }