Show / Hide Table of Contents

Class SharedBatteryDrainerSystem

Basic draining prediction and API, all real logic is handled serverside.

Inheritance
System.Object
SharedBatteryDrainerSystem
BatteryDrainerSystem
Namespace: Content.Shared.Ninja.Systems
Assembly: Content.Shared.dll
Syntax
public abstract class SharedBatteryDrainerSystem : EntitySystem

Methods

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

OnDoAfterAttempt(EntityUid, BatteryDrainerComponent, DoAfterAttemptEvent<DrainDoAfterEvent>)

Cancel any drain doafters if the battery is removed or gets filled.

Declaration
protected virtual void OnDoAfterAttempt(EntityUid uid, BatteryDrainerComponent comp, DoAfterAttemptEvent<DrainDoAfterEvent> args)
Parameters
Type Name Description
EntityUid uid
BatteryDrainerComponent comp
DoAfterAttemptEvent<DrainDoAfterEvent> args
| Improve this Doc View Source

SetBattery(EntityUid, Nullable<EntityUid>, BatteryDrainerComponent)

Sets the battery field on the drainer.

Declaration
public void SetBattery(EntityUid uid, EntityUid? battery, BatteryDrainerComponent comp = null)
Parameters
Type Name Description
EntityUid uid
System.Nullable<EntityUid> battery
BatteryDrainerComponent comp
| Improve this Doc View Source

TryDrainPower(EntityUid, BatteryDrainerComponent, EntityUid)

Attempt to drain as much power as possible into the powercell. Client always predicts this as succeeding since power is serverside and it can only fail once, when the powercell is filled or the target is emptied.

Declaration
protected virtual bool TryDrainPower(EntityUid uid, BatteryDrainerComponent comp, EntityUid target)
Parameters
Type Name Description
EntityUid uid
BatteryDrainerComponent comp
EntityUid target
Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾