SolutionScannerSystem.cs 794 B

123456789101112131415161718192021222324
  1. using Content.Shared.Chemistry.Components;
  2. using Content.Shared.Inventory;
  3. namespace Content.Shared.Chemistry;
  4. public sealed class SolutionScannerSystem : EntitySystem
  5. {
  6. public override void Initialize()
  7. {
  8. SubscribeLocalEvent<SolutionScannerComponent, SolutionScanEvent>(OnSolutionScanAttempt);
  9. SubscribeLocalEvent<SolutionScannerComponent, InventoryRelayedEvent<SolutionScanEvent>>((e, c, ev) => OnSolutionScanAttempt(e, c, ev.Args));
  10. }
  11. private void OnSolutionScanAttempt(EntityUid eid, SolutionScannerComponent component, SolutionScanEvent args)
  12. {
  13. args.CanScan = true;
  14. }
  15. }
  16. public sealed class SolutionScanEvent : EntityEventArgs, IInventoryRelayEvent
  17. {
  18. public bool CanScan;
  19. public SlotFlags TargetSlots { get; } = SlotFlags.EYES;
  20. }