1
0

SharedAgentIDCardSystem.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Content.Shared.StatusIcon;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Access.Systems
  5. {
  6. public abstract class SharedAgentIdCardSystem : EntitySystem
  7. {
  8. // Just for friending for now
  9. }
  10. /// <summary>
  11. /// Key representing which <see cref="PlayerBoundUserInterface"/> is currently open.
  12. /// Useful when there are multiple UI for an object. Here it's future-proofing only.
  13. /// </summary>
  14. [Serializable, NetSerializable]
  15. public enum AgentIDCardUiKey : byte
  16. {
  17. Key,
  18. }
  19. /// <summary>
  20. /// Represents an <see cref="AgentIDCardComponent"/> state that can be sent to the client
  21. /// </summary>
  22. [Serializable, NetSerializable]
  23. public sealed class AgentIDCardBoundUserInterfaceState : BoundUserInterfaceState
  24. {
  25. public string CurrentName { get; }
  26. public string CurrentJob { get; }
  27. public string CurrentJobIconId { get; }
  28. public AgentIDCardBoundUserInterfaceState(string currentName, string currentJob, string currentJobIconId)
  29. {
  30. CurrentName = currentName;
  31. CurrentJob = currentJob;
  32. CurrentJobIconId = currentJobIconId;
  33. }
  34. }
  35. [Serializable, NetSerializable]
  36. public sealed class AgentIDCardNameChangedMessage : BoundUserInterfaceMessage
  37. {
  38. public string Name { get; }
  39. public AgentIDCardNameChangedMessage(string name)
  40. {
  41. Name = name;
  42. }
  43. }
  44. [Serializable, NetSerializable]
  45. public sealed class AgentIDCardJobChangedMessage : BoundUserInterfaceMessage
  46. {
  47. public string Job { get; }
  48. public AgentIDCardJobChangedMessage(string job)
  49. {
  50. Job = job;
  51. }
  52. }
  53. [Serializable, NetSerializable]
  54. public sealed class AgentIDCardJobIconChangedMessage : BoundUserInterfaceMessage
  55. {
  56. public ProtoId<JobIconPrototype> JobIconId { get; }
  57. public AgentIDCardJobIconChangedMessage(ProtoId<JobIconPrototype> jobIconId)
  58. {
  59. JobIconId = jobIconId;
  60. }
  61. }
  62. }