AdminPermsChangedEventArgs.cs 942 B

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Administration;
  2. using Robust.Shared.Player;
  3. namespace Content.Server.Administration
  4. {
  5. /// <summary>
  6. /// Sealed when the permissions of an admin on the server change.
  7. /// </summary>
  8. public sealed class AdminPermsChangedEventArgs : EventArgs
  9. {
  10. public AdminPermsChangedEventArgs(ICommonSession player, AdminFlags? flags)
  11. {
  12. Player = player;
  13. Flags = flags;
  14. }
  15. /// <summary>
  16. /// The player that had their admin permissions changed.
  17. /// </summary>
  18. public ICommonSession Player { get; }
  19. /// <summary>
  20. /// The admin flags of the player. Null if the player is no longer an admin.
  21. /// </summary>
  22. public AdminFlags? Flags { get; }
  23. /// <summary>
  24. /// Whether the player is now an admin.
  25. /// </summary>
  26. public bool IsAdmin => Flags.HasValue;
  27. }
  28. }