ServerAlertsSystem.cs 476 B

12345678910111213141516171819
  1. using Content.Shared.Alert;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Server.Alert;
  4. internal sealed class ServerAlertsSystem : AlertsSystem
  5. {
  6. public override void Initialize()
  7. {
  8. base.Initialize();
  9. SubscribeLocalEvent<AlertsComponent, ComponentGetState>(OnGetState);
  10. }
  11. private void OnGetState(Entity<AlertsComponent> alerts, ref ComponentGetState args)
  12. {
  13. args.State = new AlertComponentState(alerts.Comp.Alerts);
  14. }
  15. }