1
0

SharedStunProviderSystem.cs 620 B

12345678910111213141516171819202122
  1. using Content.Shared.Ninja.Components;
  2. namespace Content.Shared.Ninja.Systems;
  3. /// <summary>
  4. /// All interaction logic is implemented serverside.
  5. /// This is in shared for API and access.
  6. /// </summary>
  7. public abstract class SharedStunProviderSystem : EntitySystem
  8. {
  9. /// <summary>
  10. /// Set the battery field on the stun provider.
  11. /// </summary>
  12. public void SetBattery(Entity<StunProviderComponent?> ent, EntityUid? battery)
  13. {
  14. if (!Resolve(ent, ref ent.Comp) || ent.Comp.BatteryUid == battery)
  15. return;
  16. ent.Comp.BatteryUid = battery;
  17. Dirty(ent, ent.Comp);
  18. }
  19. }