SharedCrewManifestSystem.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Content.Shared.Eui;
  2. using NetSerializer;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.CrewManifest;
  5. /// <summary>
  6. /// A message to send to the server when requesting a crew manifest.
  7. /// CrewManifestSystem will open an EUI that will send the crew manifest
  8. /// to the player when it is updated.
  9. /// </summary>
  10. [Serializable, NetSerializable]
  11. public sealed class RequestCrewManifestMessage : EntityEventArgs
  12. {
  13. public NetEntity Id { get; }
  14. public RequestCrewManifestMessage(NetEntity id)
  15. {
  16. Id = id;
  17. }
  18. }
  19. [Serializable, NetSerializable]
  20. public sealed class CrewManifestEuiState : EuiStateBase
  21. {
  22. public string StationName { get; }
  23. public CrewManifestEntries? Entries { get; }
  24. public CrewManifestEuiState(string stationName, CrewManifestEntries? entries)
  25. {
  26. StationName = stationName;
  27. Entries = entries;
  28. }
  29. }
  30. [Serializable, NetSerializable]
  31. public sealed class CrewManifestEntries
  32. {
  33. /// <summary>
  34. /// Entries in the crew manifest. Goes by department ID.
  35. /// </summary>
  36. // public Dictionary<string, List<CrewManifestEntry>> Entries = new();
  37. public CrewManifestEntry[] Entries = Array.Empty<CrewManifestEntry>();
  38. }
  39. [Serializable, NetSerializable]
  40. public sealed class CrewManifestEntry
  41. {
  42. public string Name { get; }
  43. public string JobTitle { get; }
  44. public string JobIcon { get; }
  45. public string JobPrototype { get; }
  46. public CrewManifestEntry(string name, string jobTitle, string jobIcon, string jobPrototype)
  47. {
  48. Name = name;
  49. JobTitle = jobTitle;
  50. JobIcon = jobIcon;
  51. JobPrototype = jobPrototype;
  52. }
  53. }
  54. /// <summary>
  55. /// Tells the server to open a crew manifest UI from
  56. /// this entity's point of view.
  57. /// </summary>
  58. [Serializable, NetSerializable]
  59. public sealed class CrewManifestOpenUiMessage : BoundUserInterfaceMessage
  60. {}