AiInteractWireAction.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Server.Wires;
  2. using Content.Shared.Doors;
  3. using Content.Shared.Silicons.StationAi;
  4. using Content.Shared.Wires;
  5. namespace Content.Server.Silicons.StationAi;
  6. /// <summary>
  7. /// Controls whether an AI can interact with the target entity.
  8. /// </summary>
  9. public sealed partial class AiInteractWireAction : ComponentWireAction<StationAiWhitelistComponent>
  10. {
  11. public override string Name { get; set; } = "wire-name-ai-act-light";
  12. public override Color Color { get; set; } = Color.DeepSkyBlue;
  13. public override object StatusKey => AirlockWireStatus.AiControlIndicator;
  14. public override StatusLightState? GetLightState(Wire wire, StationAiWhitelistComponent component)
  15. {
  16. return component.Enabled ? StatusLightState.On : StatusLightState.Off;
  17. }
  18. public override bool Cut(EntityUid user, Wire wire, StationAiWhitelistComponent component)
  19. {
  20. return EntityManager.System<SharedStationAiSystem>()
  21. .SetWhitelistEnabled((component.Owner, component), false, announce: true);
  22. }
  23. public override bool Mend(EntityUid user, Wire wire, StationAiWhitelistComponent component)
  24. {
  25. return EntityManager.System<SharedStationAiSystem>()
  26. .SetWhitelistEnabled((component.Owner, component), true);
  27. }
  28. public override void Pulse(EntityUid user, Wire wire, StationAiWhitelistComponent component)
  29. {
  30. }
  31. }