private void OnRemoved(EntityUid uid, ChargerComponent component, EntRemovedFromContainerMessage args) { if (args.Container.ID != component.ChargerSlot.ID) { return; } component.UpdateStatus(); }
private void OnInserted(EntityUid uid, ChargerComponent component, EntInsertedIntoContainerMessage args) { if (!component.Initialized) { return; } if (args.Container.ID != component.ChargerSlot.ID) { return; } // try get a battery directly on the inserted entity if (!TryComp(args.Entity, out component.HeldBattery)) { // or by checking for a power cell slot on the inserted entity _cellSystem.TryGetBatteryFromSlot(args.Entity, out component.HeldBattery); } component.UpdateStatus(); }
private void OnPowerChanged(EntityUid uid, ChargerComponent component, PowerChangedEvent args) { component.UpdateStatus(); }