GhostRolesEuiMessages.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using Content.Shared.Eui;
  2. using Content.Shared.Roles;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Ghost.Roles
  5. {
  6. [NetSerializable, Serializable]
  7. public struct GhostRoleInfo
  8. {
  9. public uint Identifier { get; set; }
  10. public string Name { get; set; }
  11. public string Description { get; set; }
  12. public string Rules { get; set; }
  13. // TODO ROLE TIMERS
  14. // Actually make use of / enforce this requirement?
  15. // Why is this even here.
  16. // Move to ghost role prototype & respect CCvars.GameRoleTimerOverride
  17. public HashSet<JobRequirement>? Requirements { get; set; }
  18. /// <inheritdoc cref="GhostRoleKind"/>
  19. public GhostRoleKind Kind { get; set; }
  20. /// <summary>
  21. /// if <see cref="Kind"/> is <see cref="GhostRoleKind.RaffleInProgress"/>, specifies how many players are currently
  22. /// in the raffle for this role.
  23. /// </summary>
  24. public uint RafflePlayerCount { get; set; }
  25. /// <summary>
  26. /// if <see cref="Kind"/> is <see cref="GhostRoleKind.RaffleInProgress"/>, specifies when raffle finishes.
  27. /// </summary>
  28. public TimeSpan RaffleEndTime { get; set; }
  29. }
  30. [NetSerializable, Serializable]
  31. public sealed class GhostRolesEuiState : EuiStateBase
  32. {
  33. public GhostRoleInfo[] GhostRoles { get; }
  34. public GhostRolesEuiState(GhostRoleInfo[] ghostRoles)
  35. {
  36. GhostRoles = ghostRoles;
  37. }
  38. }
  39. [NetSerializable, Serializable]
  40. public sealed class RequestGhostRoleMessage : EuiMessageBase
  41. {
  42. public uint Identifier { get; }
  43. public RequestGhostRoleMessage(uint identifier)
  44. {
  45. Identifier = identifier;
  46. }
  47. }
  48. [NetSerializable, Serializable]
  49. public sealed class FollowGhostRoleMessage : EuiMessageBase
  50. {
  51. public uint Identifier { get; }
  52. public FollowGhostRoleMessage(uint identifier)
  53. {
  54. Identifier = identifier;
  55. }
  56. }
  57. [NetSerializable, Serializable]
  58. public sealed class LeaveGhostRoleRaffleMessage : EuiMessageBase
  59. {
  60. public uint Identifier { get; }
  61. public LeaveGhostRoleRaffleMessage(uint identifier)
  62. {
  63. Identifier = identifier;
  64. }
  65. }
  66. /// <summary>
  67. /// Determines whether a ghost role is a raffle role, and if it is, whether it's running.
  68. /// </summary>
  69. [NetSerializable, Serializable]
  70. public enum GhostRoleKind
  71. {
  72. /// <summary>
  73. /// Role is not a raffle role and can be taken immediately.
  74. /// </summary>
  75. FirstComeFirstServe,
  76. /// <summary>
  77. /// Role is a raffle role, but raffle hasn't started yet.
  78. /// </summary>
  79. RaffleReady,
  80. /// <summary>
  81. /// Role is raffle role and currently being raffled, but player hasn't joined raffle.
  82. /// </summary>
  83. RaffleInProgress,
  84. /// <summary>
  85. /// Role is raffle role and currently being raffled, and player joined raffle.
  86. /// </summary>
  87. RaffleJoined
  88. }
  89. }