Show / Hide Table of Contents

Class PowerCellSystem

Handles Power cells

Inheritance
System.Object
SharedPowerCellSystem
PowerCellSystem
Namespace: Content.Server.PowerCell
Assembly: Content.Server.dll
Syntax
public sealed class PowerCellSystem : SharedPowerCellSystem

Methods

| Improve this Doc View Source

HasActivatableCharge(EntityUid, PowerCellDrawComponent, PowerCellSlotComponent, Nullable<EntityUid>)

Returns whether the entity has a slotted battery and UseRate charge.

Declaration
public bool HasActivatableCharge(EntityUid uid, PowerCellDrawComponent battery = null, PowerCellSlotComponent cell = null, EntityUid? user = null)
Parameters
Type Name Description
EntityUid uid
PowerCellDrawComponent battery
PowerCellSlotComponent cell
System.Nullable<EntityUid> user

Popup to this user with the relevant detail if specified.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

HasCharge(EntityUid, Single, PowerCellSlotComponent, Nullable<EntityUid>)

Returns whether the entity has a slotted battery and charge for the requested action.

Declaration
public bool HasCharge(EntityUid uid, float charge, PowerCellSlotComponent component = null, EntityUid? user = null)
Parameters
Type Name Description
EntityUid uid
System.Single charge
PowerCellSlotComponent component
System.Nullable<EntityUid> user

Popup to this user with the relevant detail if specified.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

HasDrawCharge(EntityUid, PowerCellDrawComponent, PowerCellSlotComponent, Nullable<EntityUid>)

Whether the power cell has any power at all for the draw rate.

Declaration
public bool HasDrawCharge(EntityUid uid, PowerCellDrawComponent battery = null, PowerCellSlotComponent cell = null, EntityUid? user = null)
Parameters
Type Name Description
EntityUid uid
PowerCellDrawComponent battery
PowerCellSlotComponent cell
System.Nullable<EntityUid> user
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Initialize()

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

OnCellRemoved(EntityUid, PowerCellSlotComponent, EntRemovedFromContainerMessage)

Declaration
protected override void OnCellRemoved(EntityUid uid, PowerCellSlotComponent component, EntRemovedFromContainerMessage args)
Parameters
Type Name Description
EntityUid uid
PowerCellSlotComponent component
Robust.Shared.Containers.EntRemovedFromContainerMessage args
| Improve this Doc View Source

SetPowerCellDrawEnabled(EntityUid, Boolean, PowerCellDrawComponent)

Declaration
public void SetPowerCellDrawEnabled(EntityUid uid, bool enabled, PowerCellDrawComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.Boolean enabled
PowerCellDrawComponent component
| Improve this Doc View Source

TryGetBatteryFromSlot(EntityUid, out BatteryComponent, PowerCellSlotComponent)

Declaration
public bool TryGetBatteryFromSlot(EntityUid uid, out BatteryComponent battery, PowerCellSlotComponent component = null)
Parameters
Type Name Description
EntityUid uid
BatteryComponent battery
PowerCellSlotComponent component
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetBatteryFromSlot(EntityUid, out Nullable<EntityUid>, out BatteryComponent, PowerCellSlotComponent)

Declaration
public bool TryGetBatteryFromSlot(EntityUid uid, out EntityUid? batteryEnt, out BatteryComponent battery, PowerCellSlotComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.Nullable<EntityUid> batteryEnt
BatteryComponent battery
PowerCellSlotComponent component
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUseActivatableCharge(EntityUid, PowerCellDrawComponent, PowerCellSlotComponent, Nullable<EntityUid>)

Tries to use the UseRate for this entity.

Declaration
public bool TryUseActivatableCharge(EntityUid uid, PowerCellDrawComponent battery = null, PowerCellSlotComponent cell = null, EntityUid? user = null)
Parameters
Type Name Description
EntityUid uid
PowerCellDrawComponent battery
PowerCellSlotComponent cell
System.Nullable<EntityUid> user

Popup to this user with the relevant detail if specified.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUseCharge(EntityUid, Single, PowerCellSlotComponent, Nullable<EntityUid>)

Tries to use charge from a slotted battery.

Declaration
public bool TryUseCharge(EntityUid uid, float charge, PowerCellSlotComponent component = null, EntityUid? user = null)
Parameters
Type Name Description
EntityUid uid
System.Single charge
PowerCellSlotComponent component
System.Nullable<EntityUid> user
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Update(Single)

Declaration
public override void Update(float frameTime)
Parameters
Type Name Description
System.Single frameTime
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾